@Override public boolean hasPrimitiveValue() { return value != null && value.isPrimitive(); }
@Override public boolean hasPrimitiveValue() { return value != null && value.isPrimitive(); }
if (param.getValue().isPrimitive()) { value = param.getValue().asPrimitive().toValue(); } else if (param.getValue().isComplex()) {
/** * Checks if has null value. * * @return 'TRUE' if has null value; 'FALSE' otherwise. */ @Override public boolean hasNullValue() { return value == null || value.isPrimitive() && value.asPrimitive().toValue() == null || value.isComplex() && value.asComplex().asJavaMap().size() == 0; }
if (param.getValue().isPrimitive()) { value = param.getValue().asPrimitive().toValue(); } else if (param.getValue().isComplex()) {
/** * Checks if has null value. * * @return 'TRUE' if has null value; 'FALSE' otherwise. */ @Override public boolean hasNullValue() { return value == null || value.isPrimitive() && value.asPrimitive().toValue() == null || value.isComplex() && value.asComplex().asJavaMap().size() == 0; }
@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; }
ClientProperty property = null; if (param.getValue().isPrimitive()) { property = odataClient.getObjectFactory(). newPrimitiveProperty(param.getKey(), param.getValue().asPrimitive());
ClientProperty property = null; if (param.getValue().isPrimitive()) { property = odataClient.getObjectFactory(). newPrimitiveProperty(param.getKey(), param.getValue().asPrimitive());
while (collPropItor.hasNext()) { final ClientValue itemValue = collPropItor.next(); if (itemValue.isPrimitive()) { collection.add(CoreUtils.primitiveValueToObject(itemValue.asPrimitive(), ref)); } else if (itemValue.isComplex()) {
while (collPropItor.hasNext()) { final ClientValue itemValue = collPropItor.next(); if (itemValue.isPrimitive()) { collection.add(CoreUtils.primitiveValueToObject(itemValue.asPrimitive(), ref)); } else if (itemValue.isComplex()) {
while (collPropItor.hasNext()) { final ClientValue value = collPropItor.next(); if (value.isPrimitive()) { collection.add(primitiveValueToObject( value.asPrimitive(), getPropertyClass(typeRef, property.getName())));
while (collPropItor.hasNext()) { final ClientValue value = collPropItor.next(); if (value.isPrimitive()) { collection.add(primitiveValueToObject( value.asPrimitive(), getPropertyClass(typeRef, property.getName())));
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; }
if (value == null) { valueType = ValueType.COLLECTION_PRIMITIVE; } else if (value.isPrimitive()) { valueType = value.asPrimitive().toValue() instanceof Geospatial ? ValueType.COLLECTION_GEOSPATIAL : ValueType.COLLECTION_PRIMITIVE;
if (value == null) { valueType = ValueType.COLLECTION_PRIMITIVE; } else if (value.isPrimitive()) { valueType = value.asPrimitive().toValue() instanceof Geospatial ? ValueType.COLLECTION_GEOSPATIAL : ValueType.COLLECTION_PRIMITIVE;