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 theCollection
value
.C
- type of theCollection
value
.
- All Implemented Interfaces:
CliProperty<C>
- Direct Known Subclasses:
CliListProperty
,CliSetProperty
public abstract class CliCollectionProperty<E,C extends Collection<E>> extends AbstractCliProperty<C>
Implementation ofCliProperty
forCollection
.- 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 void
add(E item)
void
addFromString(String item)
boolean
isEmpty()
void
setFromString(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
- theCliProperty
for a single element (used as mapper to parse fromString
).mandatory
- themandatory
flag.names
- theoptions
.
-
-
Method Detail
-
setFromString
public void setFromString(String value)
- Parameters:
value
- the new value asString
to parse.
-
isEmpty
public boolean isEmpty()
- Returns:
true
if thevalue
of this property is empty (e.g.null
),false
otherwise.
-
add
public abstract void add(E item)
- Parameters:
item
- the element to add.
-
-