@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; }
@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; }
value = param.getValue().asPrimitive().toValue(); } else if (param.getValue().isComplex()) { value = param.getValue().asComplex().asJavaMap(); } else if (param.getValue().isCollection()) { value = param.getValue().asCollection().asJavaCollection();
value = param.getValue().asPrimitive().toValue(); } else if (param.getValue().isComplex()) { value = param.getValue().asComplex().asJavaMap(); } else if (param.getValue().isCollection()) { value = param.getValue().asCollection().asJavaCollection();
/** * 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; }
/** * 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; }