Annotation Interface Switch


@Target(PARAMETER) @Retention(RUNTIME) public @interface Switch
Marks a (strictly) boolean parameter as a "switch", whose value will be set by "flags", such as "-silent", which will represent a boolean parameter annotated with @Switch("silent").
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Returns the default value of this switch
    The switch / flag name.
  • Element Details

    • value

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

      boolean defaultValue
      Returns the default value of this switch
      Returns:
      The default switch value.
      Default:
      false