Annotation Interface Flag


@Target(PARAMETER) @Retention(RUNTIME) public @interface Flag
An annotation to mark a parameter as a flag.

Flags are pretty similar to normal parameters, however they do not need to come in a specific order, and are explicitly named with a special prefix when the command is invoked.

For example, /test (parameters) -name "hello there", in which name would be a flag parameter.

Flags are compatible with Default and Optional, as in, they can be marked as optional or can have a default value when not specified.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The flag name.
  • Element Details

    • value

      String value
      The flag name. If left empty, the parameter name will be used.
      Returns:
      The flag name
      Default:
      ""