@Override public String toString() { if (value == null) { return ""; } else if (typeKind.isGeospatial()) { return value.toString(); } else { try { // TODO: set facets return type.valueToString(value, null, null, Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null); } catch (EdmPrimitiveTypeException e) { throw new IllegalArgumentException(e); } } }
@Override public String toString() { if (value == null) { return ""; } else if (typeKind.isGeospatial()) { return value.toString(); } else { try { // TODO: set facets return type.valueToString(value, null, null, Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null); } catch (EdmPrimitiveTypeException e) { throw new IllegalArgumentException(e); } } }
@Override public <T> T toCastValue(final Class<T> reference) throws EdmPrimitiveTypeException { if (value == null) { return null; } else if (typeKind.isGeospatial()) { return reference.cast(value); } else { // TODO: set facets return type.valueOfString(type.valueToString(value, null, null, Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null), null, null, Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null, reference); } }
@Override public <T> T toCastValue(final Class<T> reference) throws EdmPrimitiveTypeException { if (value == null) { return null; } else if (typeKind.isGeospatial()) { return reference.cast(value); } else { // TODO: set facets return type.valueOfString(type.valueToString(value, null, null, Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null), null, null, Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null, reference); } }
private Object fromPrimitive(final JsonNode node, final EdmTypeInfo typeInfo) throws EdmPrimitiveTypeException { return node.isNull() ? null : typeInfo == null ? node.asText() : typeInfo.getPrimitiveTypeKind().isGeospatial() ? getGeoDeserializer().deserialize(node, typeInfo) : ((EdmPrimitiveType) typeInfo.getType()) .valueOfString(node.asText(), true, null, Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, true, ((EdmPrimitiveType) typeInfo.getType()).getDefaultType()); }
private Object fromPrimitive(final JsonNode node, final EdmTypeInfo typeInfo) throws EdmPrimitiveTypeException { return node.isNull() ? null : typeInfo == null ? node.asText() : typeInfo.getPrimitiveTypeKind().isGeospatial() ? getGeoDeserializer().deserialize(node, typeInfo) : ((EdmPrimitiveType) typeInfo.getType()) .valueOfString(node.asText(), true, null, Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, true, ((EdmPrimitiveType) typeInfo.getType()).getDefaultType()); }
final XMLEvent event = reader.nextEvent(); if (event.isStartElement() && typeInfo != null && typeInfo.getPrimitiveTypeKind().isGeospatial()) { final EdmPrimitiveTypeKind geoType = EdmPrimitiveTypeKind.valueOfFQN(typeInfo.getFullQualifiedName().toString()); && (typeInfo == null || !typeInfo.getPrimitiveTypeKind().isGeospatial())) { final String stringValue = event.asCharacters().getData(); if (typeInfo == null) {
final XMLEvent event = reader.nextEvent(); if (event.isStartElement() && typeInfo != null && typeInfo.getPrimitiveTypeKind().isGeospatial()) { final EdmPrimitiveTypeKind geoType = EdmPrimitiveTypeKind.valueOfFQN(typeInfo.getFullQualifiedName().toString()); && (typeInfo == null || !typeInfo.getPrimitiveTypeKind().isGeospatial())) { final String stringValue = event.asCharacters().getData(); if (typeInfo == null) {
|| kind == EdmPrimitiveTypeKind.TimeOfDay || kind == EdmPrimitiveTypeKind.Duration || kind == EdmPrimitiveTypeKind.Binary || kind.isGeospatial()) && odata.createPrimitiveTypeInstance(kind).equals(type)) { return tokenizer.next(entry.getKey());
|| kind == EdmPrimitiveTypeKind.TimeOfDay || kind == EdmPrimitiveTypeKind.Duration || kind == EdmPrimitiveTypeKind.Binary || kind.isGeospatial()) && odata.createPrimitiveTypeInstance(kind).equals(type)) { return tokenizer.next(entry.getKey());