HashTable under Java 1.5

I've just changed from Java 1.4 to Java 1.5.

With the mod to Hashtables my old code was

Boolean valid;

String hour, minute, second, day, month, year;

// Logic to populate the values.

Hashtable values =new Hashtable();

values.put("valid", valid);

values.put("d1", hour + minute);

values.put("d2", second + day);

values.put("d3", month + year);

Under Java 1.5 I got the "unchecked call to put(K,V)" error.

So now I wish to declare as generic Object for the V type.

Hashtable<String, Object> values =new Hashtable<String, Object> ();

Is this ok or should I declare <String, String> and use a string version for my Boolean (ie. "True", "False")

Thansk in advance

[968 byte] By [QldKeva] at [2007-10-2 16:55:09]
# 1
Cleanest solution might be to not use a Hashtable at all but to wrap your fields in a class and refer to that instead.If that's not possible, I'd likely choose HashMap<String, String> in this case, certainly not Hashtable<String, Object>
jwentinga at 2007-7-13 18:07:34 > top of Java-index,Developer Tools,Java Compiler...
# 2
Good idea with the class. Thanks for the response.
QldKeva at 2007-7-13 18:07:34 > top of Java-index,Developer Tools,Java Compiler...