de.caff.util.args

## Interface SwitchOrArgument

- All Known Subinterfaces:
    Argument, Switch
  All Known Implementing Classes:
    AbstractBasicArgument, AbstractBasicMultipleArgument, AbstractMultipleSwitch, AbstractSwitch, MultipleArgument, SimpleOnOffSwitch, SimpleOnSwitch, SimpleSwitch, SingleArgument, StringArgMultipleSwitch, StringArgSwitch

      public interface SwitchOrArgument

  A command line argument or a command line switch.
  Since:
    January 27, 2019
  Author:
    Rammi

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `consumeArgument(java.lang.String arg)` Read further arguments from the command line.
    `java.lang.String` | `getAppearance()` Get the appearance of this switch or argument on the command line.
    `java.lang.String` | `getDescription()` Get a short description for this switch.
    `boolean` | `isOptional()` Is this argument optional?
    `boolean` | `isSwitch()` Is this a switch?
    `boolean` | `isVarLength()` Does this argument or switch have a variable length?

- - ### Method Detail

    - #### isSwitch

          boolean isSwitch()

      Is this a switch?
      Returns:
        `true`: this is a switch and can be casted to `Switch`, `false`: this is a argument and can be casted to `Argument`

    - #### isOptional

          boolean isOptional()

      Is this argument optional? For switches the order is basically ignored, but it is not allowed that non-optional arguments appear after optional ones
      Returns:
        `true` when this switch or argument is optional,
        `false` if it is required

    - #### isVarLength

          boolean isVarLength()

      Does this argument or switch have a variable length? This is only allowed for the last argument/switch in the command line.
      Returns:
        `true`: this argument or switch consumes the remaining items in the command line
        `false`: this argument or switch just consumes 1 item (for arguments) or 2 items (for switches) from the command line

    - #### getAppearance

          @NotNull
          java.lang.String getAppearance()

      Get the appearance of this switch or argument on the command line.
      Returns:
        appearance

    - #### getDescription

          @NotNull
          java.lang.String getDescription()

      Get a short description for this switch.
      Returns:
        short description

    - #### consumeArgument

          boolean consumeArgument(@NotNull
                                  java.lang.String arg)

      Read further arguments from the command line. The default implementation does not remove any arguments.
      Parameters:
        `arg` - argument
      Returns:
        if more arguments may be consumed