- java.lang.Object
-
- io.github.mmm.nls.cli.AbstractCliCommand
-
- All Implemented Interfaces:
CliCommand
- Direct Known Subclasses:
CliCommandHelp
,CliCommandVersion
,NlsSynchronizer.Synchronizer
public abstract class AbstractCliCommand extends Object implements CliCommand
Abstract base implementation ofCliCommand
.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description AbstractCliCommand(Localizable help)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <P extends CliProperty<?>>
Padd(P property)
CliConsole
console()
Localizable
getHelp()
Collection<CliProperty<?>>
getProperties()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.nls.cli.CliCommand
run
-
-
-
-
Constructor Detail
-
AbstractCliCommand
public AbstractCliCommand(Localizable help)
The constructor.- Parameters:
help
- thehelp message
.
-
-
Method Detail
-
add
protected <P extends CliProperty<?>> P add(P property)
- Type Parameters:
P
- type of the givenCliProperty
.- Parameters:
property
- theCliProperty
to add.- Returns:
- the given
CliProperty
.
-
getHelp
public Localizable getHelp()
- Specified by:
getHelp
in interfaceCliCommand
- Returns:
- the
Localizable
describing this command.
-
getProperties
public Collection<CliProperty<?>> getProperties()
- Specified by:
getProperties
in interfaceCliCommand
- Returns:
- the available
properties
of thisCliCommand
.
-
console
public CliConsole console()
- Returns:
- the
CliConsole
.
-
-