Is it possible to create a Map with specified types and not generic Object class objects?
Lets say i have a Type object that is javafx.collections.ObservableMap<java.lang.Integer, java.lang.String>
and i get the subtypes of the map like this:
Class<?> keyClass = Class.forName(objectGenericTypes[0].getTypeName());
Class<?> valueClass = Class.forName(objectGenericTypes[1].getTypeName());
Can i create a Map object with the specified Integer
and String
classes from those keyClass
and valueClass
objects without using Map<Object,Object>
? (Integer
and String
can be any other Class)