Annotation Interface AllowedValues


@Retention(RUNTIME) @Target(FIELD) public @interface AllowedValues
Annotation that marks that the option/arguments are restricted to a given set of values

Unlike AllowedRawValues this restriction works against the values after they have been converted into Java objects and thus can provide more accurate restriction than AllowedValues can provide. The trade off is that enforcing this restriction is marginally more complex because it requires parsing the allowed values.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    If provided restricts the values for the option to the given set of values
  • Element Details

    • allowedValues

      String[] allowedValues
      If provided restricts the values for the option to the given set of values
      Returns:
      Allowed values
      Default:
      {}