Im using the following code to convert type object to string,
fieldValue defined as is type object .
keyl.put(fieldName, (String) fieldValue);
the values of the type object can be only java types such as
java decimal ,byte,float, calendar ,date etc ...
when i got in fieldValue value of java.util.date I got an exception since the casting is not success.
how can i overcome this issue?
fieldValueis Object type then maybe instead of casting usefieldValue.toString(), or if it can be primitive type thenString.valueOf(fieldValue).fieldValueis possiblynullthenString.valueOf(fieldValue)will preventNullPointerException