in odata2-lib/odata-client-core/src/main/java/org/apache/olingo/odata2/client/core/ep/serializer/AtomEntryEntitySerializer.java [584:622]
private static Object fetchDefaultValue(Class<?> edmType) throws EntityProviderProducerException {
if (edmType == boolean.class || edmType == Boolean.class) {
return false;
} else if (edmType == String.class) {
return "A";
} else if (edmType == byte.class || edmType == Byte.class) {
return new Byte(Byte.parseByte("0"));
} else if (edmType == char.class) {
return new Character('A');
} else if (edmType == short.class || edmType == Short.class) {
return new Short(Short.parseShort("0"));
} else if (edmType == int.class || edmType == Integer.class) {
return new Integer(0);
} else if (edmType == long.class || edmType == Long.class) {
return new Long(0L);
} else if (edmType == float.class || edmType == Float.class) {
return new Float(0.0f);
} else if (edmType == double.class || edmType == Double.class) {
return new Double(0.0d);
} else if (edmType == BigDecimal.class) {
return BigDecimal.valueOf(0.0);
} else if (edmType == UUID.class) {
return UUID.fromString("00000000-0000-0000-0000-000000000000");
} else if (edmType == Timestamp.class) {
return new Timestamp(Calendar.getInstance().getTimeInMillis());
} else if (edmType == Calendar.class) {
return Calendar.getInstance();
} else if (edmType == byte[].class || edmType == Byte[].class) {
return new byte[0];
} else if (edmType == Date.class) {
return new Date();
} else if (edmType == BigInteger.class) {
return new BigInteger("0");
} else if (edmType == Time.class) {
return new Time(0L);
} else {
throw new EntityProviderProducerException(EdmSimpleTypeException.VALUE_TYPE_NOT_SUPPORTED);
}
}