Annotation Interface Values


@Retention(RUNTIME) @Target(PARAMETER) @AvailableSince("1.7.6") public @interface Values
Restricts a parameter to a predefined set of allowed string values. Matching may be case-sensitive depending on caseSensitive().
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Specific allowed values
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the values should be checked upon for being exactly the SAME as the input (including upper and lower case)
  • Element Details

    • value

      String[] value
      Specific allowed values
      Returns:
      the only allowed input values.
    • caseSensitive

      boolean caseSensitive
      Whether the values should be checked upon for being exactly the SAME as the input (including upper and lower case)

      example: values: ["Hello"] input: "hello"

      if this method returns true, then the input wouldn't be allowed and vice versa.
      Returns:
      if checks on values should allow difference in lower/upper cases between input and the values...
      Default:
      true