Annotation Interface Optional


@Target(PARAMETER) @Retention(RUNTIME) public @interface Optional

Parameters annotated with Optional are as the name says optional.

More formally if a command has an optional parameter the argument doesn't need to be present to execute the command.

It is also possible to pass a default value which will be used instead if the argument isn't present. The default value will be handled as a normal input and thus the TypeAdapters will try to parse it. If the parsing fails the command will still be executed but with empty or possible null values.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Returns the default value.
  • Element Details

    • value

      String value
      Returns the default value.
      Returns:
      the default value
      Default:
      ""