Annotation Type EnumVal


  • @Documented
    @Retention(RUNTIME)
    @Target({TYPE_PARAMETER,TYPE_USE})
    public @interface EnumVal
    An annotation indicating the possible values for an enum type. If an expression's type has this annotation, then at run time, the expression evaluates to one of the enum values named by the arguments. EnumVal uses the simple name of the enum value: the EnumVal type corresponding to MyEnum.MY_VALUE is @EnumVal("MY_VALUE").

    This annotation is treated as StringVal internally by the Constant Value Checker.

    See the Checker Framework Manual:
    Constant Value Checker
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String[] value
      The simple names of the possible enum values for an expression with the annotated type.
    • Element Detail

      • value

        java.lang.String[] value
        The simple names of the possible enum values for an expression with the annotated type.
        Returns:
        the simple names of the possible enum values for an expression with the annotated type