Hello i have got hash map with value:
private static final LinkedHashMap<Class<? extends Annotation> , Class<? extends AGenerator<?>>> annotationGeneratorMap = new LinkedHashMap<Class<? extends Annotation>, Class<? extends AGenerator<?>>>();
and my numeric Generator looks like :
public abstract class NumericGenerator<T extends Number> extends AGenerator<T>{
public NumericGenerator(Field field) {
super(field);
// TODO Auto-generated constructor stub
}
public T random() {
// TODO Auto-generated method stub
return null;
}
}
And i have got problem when i need to put this class into hashmap :
annotationGeneratorMap.put(GenerateNumeric.class, NumericGenerator.class);
And in eclipse i have got error the method is not applicable for the argument ???
but :
annotationGeneratorMap.put(GenerateNumeric.class, (Class<? extends AGenerator<?>>) NumericGenerator.class);
and @SuppressWarnings("unchecked") is good ..:/
Can i do this without casting ?? (Class<? extends AGenerator<?>>) NumericGenerator.class