I want the sub classes to pass specific enum values to parent class in extends
, such that these specific enum value would be used in parent class in some annotation.
Below is what I exactly want to achieve.
public enum SomeEnum {
VAL1, VAL2;
}
public @interface SomeAnnotation {
SomeEnum someValue();
}
//below starts all fuzzy things : I want a specific value of enum
public class parent<FetchType> {// not sure what exactly should write between < >
// below,at someValue I want the specific enum passed by child , means
// the value passed between < and >
@SomeAnnotation(someValue = null /* here should be the specific enum value passed
as type parameter of this class */)
private String someString;
//getter-setter
}
//as i said , for child1 , i need SomeEnum.VAL1 to be passed to parent and
// SomeEnum.VAL2 for child2.
public class child1 extends parent<SomeEnum.VAL1>{}
public class child2 extends parent<SomeEnum.VAL2>{}