I'm trying to create a factory (generating new instances from a String parameter).
I've got a Monster class (the superclass) and Robot1 class (extends Monster).
My factory declares :
private static final ImmutableMap<String, Class<? extends Monster>> DISPATCHER = ImmutableMap.of("robot1", Robot1.class);
But I get :
Type mismatch: cannot convert from ImmutableMap<String,Class<Robot1>> to ImmutableMap<String,Class<? extends Monster>>