public class CliValueMap extends Object
Modifier and Type | Field and Description |
---|---|
private CliState |
cliState
The
CliState . |
private CliParserDependencies |
dependencies
|
private org.slf4j.Logger |
logger
The
Logger to use. |
private Map<CliParameterContainer,CliValueContainer> |
map |
Constructor and Description |
---|
CliValueMap(CliState cliState,
CliParserDependencies dependencies,
org.slf4j.Logger logger)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
assign(Object state)
This method applies the parsed CLI values to the given
state . |
CliValueContainer |
get(CliParameterContainer parameterContainer)
This method gets the
CliValueContainer for the given CliParameterContainer . |
CliValueContainer |
getOrCreate(CliParameterContainer parameterContainer)
This method gets the
CliValueContainer for the given CliParameterContainer . |
private final Map<CliParameterContainer,CliValueContainer> map
private final CliParserDependencies dependencies
private final org.slf4j.Logger logger
Logger
to use.public CliValueMap(CliState cliState, CliParserDependencies dependencies, org.slf4j.Logger logger)
cliState
- is the CliState
.dependencies
- is the CliParserDependencies
.logger
- is the Logger
to use.public CliValueContainer get(CliParameterContainer parameterContainer)
CliValueContainer
for the given CliParameterContainer
.parameterContainer
- is the CliParameterContainer
that acts as key to the requested
CliValueContainerObject
.CliValueContainerObject
or null
if NOT present.public CliValueContainer getOrCreate(CliParameterContainer parameterContainer)
CliValueContainer
for the given CliParameterContainer
. In advance to
get(CliParameterContainer)
this method will create an according CliValueContainerObject
if not
present and the CliParameterContainer
has a setter
with a
property-type
reflecting an array, Collection
or
Map
.parameterContainer
- is the CliParameterContainer
that acts as key to the requested
CliValueContainerObject
.CliValueContainerObject
or null
if NOT present and NOT created.public void assign(Object state)
state
.state
- is the state-object
where to apply the values of this
CliValueMap
.Copyright © 2001–2016 mmm-Team. All rights reserved.