there is something about my code that i dont understand.
when i execute the following code className1 and value1 get their value right from the entry, but when for the className2 i am getting ClassCastException Date can not be cast to a String when processing an entry with getValue = {java.util.Date@11632}”Sun Jun 01 00:00:00 PDT 1997″
String key1="", className1="", value1="";
String key2="", className2="", value2="";
Object obj;
Map<String, String> inputValues = reportOptions.getInputValues();
for (Map.Entry<String, String> entry: inputValues.entrySet()){
key1 = entry.getKey().toString();
obj = entry.getValue();
className1 = obj.getClass().getName();
value1 = obj.toString();
className2 = entry.getValue().getClass().getName();
value2 = entry.getValue().toString();
}
should be simple but i am missing it…
I’m guessing this is because your map that you get isn’t actually a
Map<String,String>but rather aMap<String,Date>.