I want to write an annotation that hast a EnumArray Field. Default value should be all values of the Enum. This code works but I don't want to specify every enum manually.
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface CommonScope
{
ECountry[] countries() default {ECountry.AT, ECountry.DE};
}
I want to do something like this:
ECountry[] countries() default ECountry.values();
Can someone tell me how to achieve this?
Thank you
EnumSet.allOf(A.class).toArray().public static ECountry[] COUNTRY = (EStatus[]) EnumSet.allOf(ECountry.class).toArray();