@Override public ClientCollectionValue<ClientValue> getCollectionValue() { return hasCollectionValue() ? getValue().<ClientValue> asCollection() : null; }
@Override public ClientCollectionValue<ClientValue> getCollectionValue() { return hasCollectionValue() ? getValue().<ClientValue> asCollection() : null; }
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; }
} else if (param.getValue().isCollection()) { property = odataClient.getObjectFactory(). newCollectionProperty(param.getKey(), param.getValue().asCollection()); } else if (param.getValue().isEnum()) { property = odataClient.getObjectFactory().newEnumProperty(param.getKey(), param.getValue().asEnum());
} else if (param.getValue().isCollection()) { property = odataClient.getObjectFactory(). newCollectionProperty(param.getKey(), param.getValue().asCollection()); } else if (param.getValue().isEnum()) { property = odataClient.getObjectFactory().newEnumProperty(param.getKey(), param.getValue().asEnum());
final ArrayList<Object> collection = new ArrayList<Object>(); final Iterator<ClientValue> collPropItor = value.asCollection().iterator(); while (collPropItor.hasNext()) { final ClientValue itemValue = collPropItor.next();
final ArrayList<Object> collection = new ArrayList<Object>(); final Iterator<ClientValue> collPropItor = value.asCollection().iterator(); while (collPropItor.hasNext()) { final ClientValue itemValue = collPropItor.next();
final Iterator<ClientValue> collPropItor = property.getValue().asCollection().iterator(); while (collPropItor.hasNext()) { final ClientValue value = collPropItor.next();
final Iterator<ClientValue> collPropItor = property.getValue().asCollection().iterator(); while (collPropItor.hasNext()) { final ClientValue value = collPropItor.next();
protected Object getValue(final ClientValue value) { Object valueResource = null; if (value == null) { return null; } if (value.isEnum()) { valueResource = value.asEnum().getValue(); } else if (value.isPrimitive()) { valueResource = value.asPrimitive().toValue(); } else if (value.isComplex()) { List<Property> complexProperties = new ArrayList<Property>(); for (final ClientProperty propertyValue : value.asComplex()) { complexProperties.add(getProperty(propertyValue)); } final ComplexValue lcValueResource = new ComplexValue(); lcValueResource.getValue().addAll(complexProperties); annotations(value.asComplex(), lcValueResource); links(value.asComplex(), lcValueResource); lcValueResource.setTypeName(value.asComplex().getTypeName()); valueResource = lcValueResource; } else if (value.isCollection()) { final ClientCollectionValue<? extends ClientValue> _value = value.asCollection(); ArrayList<Object> lcValueResource = new ArrayList<Object>(); for (final ClientValue collectionValue : _value) { lcValueResource.add(getValue(collectionValue)); } valueResource = lcValueResource; } return valueResource; }
protected Object getValue(final ClientValue value) { Object valueResource = null; if (value == null) { return null; } if (value.isEnum()) { valueResource = value.asEnum().getValue(); } else if (value.isPrimitive()) { valueResource = value.asPrimitive().toValue(); } else if (value.isComplex()) { List<Property> complexProperties = new ArrayList<Property>(); for (final ClientProperty propertyValue : value.asComplex()) { complexProperties.add(getProperty(propertyValue)); } final ComplexValue lcValueResource = new ComplexValue(); lcValueResource.getValue().addAll(complexProperties); annotations(value.asComplex(), lcValueResource); links(value.asComplex(), lcValueResource); lcValueResource.setTypeName(value.asComplex().getTypeName()); valueResource = lcValueResource; } else if (value.isCollection()) { final ClientCollectionValue<? extends ClientValue> _value = value.asCollection(); ArrayList<Object> lcValueResource = new ArrayList<Object>(); for (final ClientValue collectionValue : _value) { lcValueResource.add(getValue(collectionValue)); } valueResource = lcValueResource; } return valueResource; }
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());
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 List items = new ArrayList(); for (ClientValue item : property.getValue().asCollection()) { items.add(ProxyUtils.getComplexProxy( service, final List items = new ArrayList(); for (ClientValue item : property.getValue().asCollection()) { items.add(item.asPrimitive().toValue());
final List items = new ArrayList(); for (ClientValue item : property.getValue().asCollection()) { items.add(ProxyUtils.getComplexProxy( service, final List items = new ArrayList(); for (ClientValue item : property.getValue().asCollection()) { items.add(item.asPrimitive().toValue());
public static ClientProperty getODataProperty( final EdmEnabledODataClient client, final String name, final EdmTypeInfo type, final Object obj) { ClientProperty property; try { if (obj == null) { property = client.getObjectFactory().newPrimitiveProperty(name, null); } else { final EdmTypeInfo valueType = type == null ? guessTypeFromObject(client, obj) : type; final ClientValue value = getODataValue(client, valueType, obj); if (valueType.isCollection()) { property = client.getObjectFactory().newCollectionProperty(name, value.asCollection()); } else if (valueType.isPrimitiveType()) { property = client.getObjectFactory().newPrimitiveProperty(name, value.asPrimitive()); } else if (valueType.isComplexType()) { property = client.getObjectFactory().newComplexProperty(name, value.asComplex()); } else if (valueType.isEnumType()) { property = client.getObjectFactory().newEnumProperty(name, value.asEnum()); } else { throw new UnsupportedOperationException("Usupported object type " + valueType.getFullQualifiedName()); } } return property; } catch (Exception e) { throw new IllegalStateException(e); } }
public static ClientProperty getODataProperty( final EdmEnabledODataClient client, final String name, final EdmTypeInfo type, final Object obj) { ClientProperty property; try { if (obj == null) { property = client.getObjectFactory().newPrimitiveProperty(name, null); } else { final EdmTypeInfo valueType = type == null ? guessTypeFromObject(client, obj) : type; final ClientValue value = getODataValue(client, valueType, obj); if (valueType.isCollection()) { property = client.getObjectFactory().newCollectionProperty(name, value.asCollection()); } else if (valueType.isPrimitiveType()) { property = client.getObjectFactory().newPrimitiveProperty(name, value.asPrimitive()); } else if (valueType.isComplexType()) { property = client.getObjectFactory().newComplexProperty(name, value.asComplex()); } else if (valueType.isEnumType()) { property = client.getObjectFactory().newEnumProperty(name, value.asEnum()); } else { throw new UnsupportedOperationException("Usupported object type " + valueType.getFullQualifiedName()); } } return property; } catch (Exception e) { throw new IllegalStateException(e); } }