Module net.sourceforge.argparse4j
Class CollectionArgumentChoice<E>
java.lang.Object
net.sourceforge.argparse4j.impl.choice.CollectionArgumentChoice<E>
- All Implemented Interfaces:
ArgumentChoice
Choice from given collection of values.
contains(Object) checks given val is contained in values
given in constructor argument.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCollectionArgumentChoice(E... values) Initializes this object from given values.CollectionArgumentChoice(Collection<E> values) Initializes this object from given values. -
Method Summary
-
Field Details
-
values_
-
-
Constructor Details
-
CollectionArgumentChoice
Initializes this object from given values.- Parameters:
values- Valid values
-
CollectionArgumentChoice
Initializes this object from given values.- Parameters:
values- Valid values
-
-
Method Details
-
contains
Description copied from interface:ArgumentChoiceReturns
trueiffvalis valid choice according to this object's constraint.If the objects derived from
RuntimeExceptionare thrown because of invalid input from command line, subclass must catch these exceptions and returnfalse.- Specified by:
containsin interfaceArgumentChoice- Parameters:
val- The attribute value.- Returns:
trueorfalse.
-
textualFormat
Description copied from interface:ArgumentChoiceReturn textual representation of this choice.
This string will be used in help and error messages.
- Specified by:
textualFormatin interfaceArgumentChoice- Returns:
- The textual representation of this choice.
-
toString
-