Class ArrayOption<T>

java.lang.Object
org.refcodes.cli.ArrayOperand<T>
org.refcodes.cli.ArrayOption<T>
Type Parameters:
T - the generic type
All Implemented Interfaces:
Cloneable, Comparable<Operand<?>>, ArgsAccessor, Constituent, Operand<T[]>, Option<T[]>, Synopsisable, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.Clonable, org.refcodes.mixin.DescriptionAccessor, org.refcodes.mixin.Resetable, org.refcodes.mixin.Schemable, org.refcodes.mixin.TypeAccessor<T[]>, org.refcodes.mixin.ValueAccessor<T[]>

public class ArrayOption<T> extends ArrayOperand<T> implements Option<T[]>
Creates an array representation facade for the encapsulated Option. This way any Option can also be used as an array Option, e.g. it can be provided multiple times in the command line arguments.
  • Constructor Details

    • ArrayOption

      public ArrayOption(Option<T> aOption)
      Constructs the ArrayOption by encapsulating the given Option and providing its definition as array definition to the CLI.
      Parameters:
      aOption - The Option which's array counterpart is to be defined.
    • ArrayOption

      public ArrayOption(Option<T> aOption, int aLength)
      Constructs the ArrayOption by encapsulating the given Option and providing its definition as array definition to the CLI.
      Parameters:
      aOption - The Option which's array counterpart is to be defined.
      aLength - The number of array elements, or -1 if there is no limit.
    • ArrayOption

      public ArrayOption(Option<T> aOption, int aMinLength, int aMaxLength)
      Constructs the ArrayOption by encapsulating the given Option and providing its definition as array definition to the CLI.
      Parameters:
      aOption - The Option which's array counterpart is to be defined.
      aMinLength - The minimum number of array elements, or -1 if there is no limit.
      aMaxLength - The maximum number of array elements, or -1 if there is no limit.
  • Method Details