, , (.. String), (.. ) , . , - - "checker" :
Map<?,?> conf = deserialize(rsrc);
Map<String, String> checked = checkMap(conf, String.class, String.class);
:
@SuppressWarnings("unchecked")
public static <K, V> Map<K,V> checkMap(Map<?,?> map, Class<? extends K> k, Class<? extends V> v) {
for (Map.Entry<?, ?> e : map) {
k.cast(e.getKey());
v.cast(e.getValue());
}
return (Map<K,V>) map;
}