You could use for (String key : keys) { Object o = get(key);
to return an Object, call getClass().getName()
on it to get the type, and then do a set of if name.equals("String") type things to work out which method you should actually be calling, in order to get the value?