I have a generic type that is parameterized on some Enum, declared like this:
public class FlagsField<T extends Enum<T>> {
private EnumSet<T> _flagSet;
public FlagsField() {
_flagSet = EnumSet.<T>noneOf( /* what goes here? */ );
}
...
}
I want to initialize _flagsField in the constructor as above, but can't figure out for the life of me what the right parameter to the noneOf method is. It needs to be of type Class<T>
. If this weren't a generic, you'd use MyFooEnumType.class
here, but T.class
is not valid.
Thanks!