Module io.github.mmm.nls.cli
Package io.github.mmm.nls.cli.property
Class CliCollectionProperty<E,C extends Collection<E>>
- java.lang.Object
-
- io.github.mmm.nls.cli.property.AbstractCliProperty<C>
-
- io.github.mmm.nls.cli.property.CliCollectionProperty<E,C>
-
- Type Parameters:
E- type of the elements contained in theCollectionvalue.C- type of theCollectionvalue.
- All Implemented Interfaces:
CliProperty<C>
- Direct Known Subclasses:
CliListProperty,CliSetProperty
public abstract class CliCollectionProperty<E,C extends Collection<E>> extends AbstractCliProperty<C>
Implementation ofCliPropertyforCollection.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description CliCollectionProperty(Localizable help, CliProperty<E> property, boolean mandatory, String... names)The constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidadd(E item)voidaddFromString(String item)booleanisEmpty()voidsetFromString(String value)-
Methods inherited from class io.github.mmm.nls.cli.property.AbstractCliProperty
getHelp, getNames, isMandatory, isOption, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.mmm.nls.cli.property.CliProperty
get, getAsString, getName, getValueClass, isValid, set, validate
-
-
-
-
Constructor Detail
-
CliCollectionProperty
public CliCollectionProperty(Localizable help, CliProperty<E> property, boolean mandatory, String... names)
The constructor.- Parameters:
help- thehelp message.property- theCliPropertyfor a single element (used as mapper to parse fromString).mandatory- themandatoryflag.names- theoptions.
-
-
Method Detail
-
setFromString
public void setFromString(String value)
- Parameters:
value- the new value asStringto parse.
-
isEmpty
public boolean isEmpty()
- Returns:
trueif thevalueof this property is empty (e.g.null),falseotherwise.
-
add
public abstract void add(E item)
- Parameters:
item- the element to add.
-
-