de.caff.util.args

## Class MultipleArgument

- java.lang.Object
- - de.caff.util.args.AbstractBasicArgument
  - - de.caff.util.args.AbstractBasicMultipleArgument
    - - de.caff.util.args.MultipleArgument

- All Implemented Interfaces:
    Argument, SwitchOrArgument

      public class MultipleArgument
      extends AbstractBasicMultipleArgument

  A multiple argument.
  Since:
    January 27, 2019
  Author:
    Rammi

- - ### Field Summary

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

      `maxCount, minCount`

    - ### Fields inherited from interface de.caff.util.args.Argument

      `ARGUMENT_FORMAT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultipleArgument(java.lang.String name, java.lang.String description, int minCount)` Constructor.
    `MultipleArgument(java.lang.String name, java.lang.String description, int minCount, int maxCount)` Constructor.

  - ### 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.
    `java.util.List<java.lang.String>` | `getCollectedArguments()` Get the collected arguments.
    `boolean` | `isCorrect()` Are there a correct number of collected arguments?

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

      `getMaximalCount, getMinimalCount, isVarLength`

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

      `getAppearance, getDescription`

    - ### 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.Argument

      `isOptional, isSwitch`

- - ### Constructor Detail

    - #### MultipleArgument

          public MultipleArgument(@NotNull
                                  java.lang.String name,
                                  @NotNull
                                  java.lang.String description,
                                  int minCount,
                                  int maxCount)

      Constructor.
      Parameters:
        `name` - argument name
        `description` - argument description
        `minCount` - minimal expected count
        `maxCount` - maximal expected count

    - #### MultipleArgument

          public MultipleArgument(@NotNull
                                  java.lang.String name,
                                  @NotNull
                                  java.lang.String description,
                                  int minCount)

      Constructor. This will allow an unlimited number of arguments.
      Parameters:
        `name` - argument name
        `description` - argument description
        `minCount` - minimal expected count

  - ### Method Detail

    - #### isCorrect

          public boolean isCorrect()

      Are there a correct number of collected arguments?
      Returns:
        `true` if the number is in the expected range,
        `false` otherwise

    - #### getCollectedArguments

          @NotNull
          public java.util.List<java.lang.String> getCollectedArguments()

      Get the collected arguments.
      Returns:
        collected arguments

    - #### consumeArgument

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

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