As the title, I want to check an attribute value is exists or not in a list by annotation. Ex:
private final String[] list = {"a", "b", "c", "d"}
@Includes(list = list)
private String state;
but there is an error Attribute must be constant
How can I do it ? Btw, is it a good solution to check this by annotation ?
Here is my annotation:
@Target(ElementType.FIELD)
@Inherited
@Retention(RetentionPolicy.RUNTIME)
public @interface Includes {
String[] list();
}