I am probably wrong with terminology which doesn't help me to google the answer, but the question boils down to this:
I have a set of objects declared like this:
public interface ActivationService<T extends Activator> {
T getActivator(Item item);
}
, so the set is declared like this:
Set<ActivationService>_activationServices = new HashSet<>();
I want to transform it into a map in order to lookup the appropriate "activation service" easier.
Map<Class<? extends Activator>, Set<ActivationService>> _actsCache = new HashMap<>();
Once I know how to get this T
parameter from an object of a class, I will be able to do it. How do I get this from an object? The TypeVariable
interface confuses me.