@Override public Map<String, Object> asJavaMap() { final Map<String, Object> result = new LinkedHashMap<String, Object>(); for (Map.Entry<String, ClientProperty> entry : fields.entrySet()) { Object value = null; if (entry.getValue().hasPrimitiveValue()) { value = entry.getValue().getPrimitiveValue().toValue(); } else if (entry.getValue().hasComplexValue()) { value = entry.getValue().getComplexValue().asJavaMap(); } else if (entry.getValue().hasCollectionValue()) { value = entry.getValue().getCollectionValue().asJavaCollection(); } else if (entry.getValue().hasEnumValue()) { value = entry.getValue().getEnumValue().toString(); } result.put(entry.getKey(), value); } return result; }
final ClientCollectionValue<ClientValue> collectionValue = odataValuable.getCollectionValue(); propertyResource.setType(collectionValue.getTypeName()); final ClientValue value = collectionValue.iterator().hasNext() ? collectionValue.iterator().next() : null; ValueType valueType = ValueType.COLLECTION_PRIMITIVE; if (value == null) {
final ArrayList<Object> collection = new ArrayList<Object>(); final Iterator<ClientValue> collPropItor = value.asCollection().iterator(); while (collPropItor.hasNext()) { final ClientValue itemValue = collPropItor.next();
value.asCollection().add(getODataValue(client, intType, collectionItem).asPrimitive()); } else if (intType.isEnumType()) { value.asCollection().add((getODataValue(client, intType, collectionItem)).asEnum()); } else if (intType.isComplexType()) { value.asCollection().add(getODataValue(client, intType, collectionItem).asComplex()); } else { throw new UnsupportedOperationException("Unsupported object type " + intType.getFullQualifiedName());
final ClientCollectionValue<ClientValue> collectionValue = odataValuable.getCollectionValue(); propertyResource.setType(collectionValue.getTypeName()); final ClientValue value = collectionValue.iterator().hasNext() ? collectionValue.iterator().next() : null; ValueType valueType = ValueType.COLLECTION_PRIMITIVE; if (value == null) {
final ArrayList<Object> collection = new ArrayList<Object>(); final Iterator<ClientValue> collPropItor = value.asCollection().iterator(); while (collPropItor.hasNext()) { final ClientValue itemValue = collPropItor.next();
value.asCollection().add(getODataValue(client, intType, collectionItem).asPrimitive()); } else if (intType.isEnumType()) { value.asCollection().add((getODataValue(client, intType, collectionItem)).asEnum()); } else if (intType.isComplexType()) { value.asCollection().add(getODataValue(client, intType, collectionItem).asComplex()); } else { throw new UnsupportedOperationException("Unsupported object type " + intType.getFullQualifiedName());
final Iterator<ClientValue> collPropItor = property.getValue().asCollection().iterator(); while (collPropItor.hasNext()) { final ClientValue value = collPropItor.next();
type = typeName == null? type : new FullQualifiedName(typeName); value.asCollection().add(getODataValue(type, fake, contextURL, metadataETag));
@Override public Map<String, Object> asJavaMap() { final Map<String, Object> result = new LinkedHashMap<String, Object>(); for (Map.Entry<String, ClientProperty> entry : fields.entrySet()) { Object value = null; if (entry.getValue().hasPrimitiveValue()) { value = entry.getValue().getPrimitiveValue().toValue(); } else if (entry.getValue().hasComplexValue()) { value = entry.getValue().getComplexValue().asJavaMap(); } else if (entry.getValue().hasCollectionValue()) { value = entry.getValue().getCollectionValue().asJavaCollection(); } else if (entry.getValue().hasEnumValue()) { value = entry.getValue().getEnumValue().toString(); } result.put(entry.getKey(), value); } return result; }
final Iterator<ClientValue> collPropItor = property.getValue().asCollection().iterator(); while (collPropItor.hasNext()) { final ClientValue value = collPropItor.next();
type = typeName == null? type : new FullQualifiedName(typeName); value.asCollection().add(getODataValue(type, fake, contextURL, metadataETag));
value = param.getValue().asComplex().asJavaMap(); } else if (param.getValue().isCollection()) { value = param.getValue().asCollection().asJavaCollection(); } else if (param.getValue().isEnum()) { value = param.getValue().asEnum().toString();
value = param.getValue().asComplex().asJavaMap(); } else if (param.getValue().isCollection()) { value = param.getValue().asCollection().asJavaCollection(); } else if (param.getValue().isEnum()) { value = param.getValue().asEnum().toString();
@Override public Collection<Object> asJavaCollection() { final List<Object> result = new ArrayList<Object>(); for (ClientValue value : values) { if (value.isPrimitive()) { result.add(value.asPrimitive().toValue()); } else if (value.isComplex()) { result.add(value.asComplex().asJavaMap()); } else if (value.isCollection()) { result.add(value.asCollection().asJavaCollection()); } else if (value.isEnum()) { result.add(value.asEnum().toString()); } } return result; }
@Override public Collection<Object> asJavaCollection() { final List<Object> result = new ArrayList<Object>(); for (ClientValue value : values) { if (value.isPrimitive()) { result.add(value.asPrimitive().toValue()); } else if (value.isComplex()) { result.add(value.asComplex().asJavaMap()); } else if (value.isCollection()) { result.add(value.asCollection().asJavaCollection()); } else if (value.isEnum()) { result.add(value.asEnum().toString()); } } return result; }