de.caff.util.args

## Class StringArgMultipleSwitch

- java.lang.Object
- - de.caff.util.args.AbstractSwitch
  - - de.caff.util.args.AbstractMultipleSwitch
    - - de.caff.util.args.StringArgMultipleSwitch

- All Implemented Interfaces:
    Switch, SwitchOrArgument

      public class StringArgMultipleSwitch
      extends AbstractMultipleSwitch

  Since:
    March 16, 2025
  Author:
    Rammi

- - ### Field Summary

    - ### Fields inherited from class de.caff.util.args.AbstractMultipleSwitch

      `maxCount, minCount`

    - ### Fields inherited from class de.caff.util.args.AbstractSwitch

      `description, longForm, shortForm`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringArgMultipleSwitch(java.lang.Character shortForm, java.lang.String longForm, java.lang.String argName, java.lang.String description, int minCount)`
    `StringArgMultipleSwitch(java.lang.Character shortForm, java.lang.String longForm, java.lang.String argName, java.lang.String description, int minCount, int maxCount)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `consumeArgument(java.lang.String arg)` Read further arguments from the command line.
    `void` | `found(char shortSwitch)` This switch appears in the command line in the given short form.
    `void` | `found(java.lang.String longSwitch)` This switch appears in the command line in the given long form.
    `java.lang.String` | `getAppearance()` Get the appearance of this switch or argument on the command line.
    `Indexable<java.lang.String>` | `getParameters()`
    `boolean` | `isVarLength()` Does this argument or switch have a variable length?
    `boolean` | `needsArguments()` Does this switch require arguments?

    - ### Methods inherited from class de.caff.util.args.AbstractSwitch

      `getDescription, getLongForms, getShortForms`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface de.caff.util.args.Switch

      `isOptional, isSwitch`

- - ### Constructor Detail

    - #### StringArgMultipleSwitch

          public StringArgMultipleSwitch(@NotNull
                                         java.lang.Character shortForm,
                                         @NotNull
                                         java.lang.String longForm,
                                         @NotNull
                                         java.lang.String argName,
                                         @NotNull
                                         java.lang.String description,
                                         int minCount)

    - #### StringArgMultipleSwitch

          public StringArgMultipleSwitch(@NotNull
                                         java.lang.Character shortForm,
                                         @NotNull
                                         java.lang.String longForm,
                                         @NotNull
                                         java.lang.String argName,
                                         @NotNull
                                         java.lang.String description,
                                         int minCount,
                                         int maxCount)

  - ### Method Detail

    - #### isVarLength

          public boolean isVarLength()

      Description copied from interface: `SwitchOrArgument`
      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

    - #### needsArguments

          public boolean needsArguments()

      Description copied from interface: `Switch`
      Does this switch require arguments? Only if it requires arguments, the `Switch.consumeArgument(String)` method will be called. The default implementation returns `false`, so always both this method and the `Switch.consumeArgument(String)` method need to be overridden.
      Returns:
        `true` if this switch requires arguments
        `false` if this switch does not require arguments
      See Also:
        `Switch.consumeArgument(String)`

    - #### consumeArgument

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

      Description copied from interface: `Switch`
      Read further arguments from the command line.
      Parameters:
        `arg` - argument
      Returns:
        if more arguments may be consumed
      See Also:
        `Switch.needsArguments()`

    - #### found

          public void found(char shortSwitch)

      Description copied from interface: `Switch`
      This switch appears in the command line in the given short form.
      Parameters:
        `shortSwitch` - short form in which this switch appeared

    - #### found

          public void found(@NotNull
                            java.lang.String longSwitch)

      Description copied from interface: `Switch`
      This switch appears in the command line in the given long form.
      Parameters:
        `longSwitch` - long form

    - #### getAppearance

          @NotNull
          public java.lang.String getAppearance()

      Description copied from interface: `SwitchOrArgument`
      Get the appearance of this switch or argument on the command line.
      Returns:
        appearance

    - #### getParameters

          @NotNull
          public Indexable<java.lang.String> getParameters()