public enum CliContainerStyle extends Enum<CliContainerStyle>
Map
or
Collection
.CliStyle.containerStyle()
,
CliOption.containerStyle()
,
CliArgument.containerStyle()
Enum Constant and Description |
---|
COMMA_SEPARATED
The
CliOption or CliArgument may occur only once. |
DEFAULT
The default style that indicates a fallback to the
CliStyle.containerStyle() . |
MULTIPLE_OCCURRENCE
The
CliOption or CliArgument may occur multiple times. |
Modifier and Type | Method and Description |
---|---|
static CliContainerStyle |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CliContainerStyle[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CliContainerStyle DEFAULT
CliStyle.containerStyle()
.public static final CliContainerStyle MULTIPLE_OCCURRENCE
CliOption
or CliArgument
may occur multiple times. The collection gets filled with all these
values in the order of their occurrence. This style is the default. For arguments
this style is
only allowed for the last CliArgument
. Foo
with a property private List<String> listProperty
annotated with a CliOption
named
--list
and with this style via
CliOption.containerStyle()
. It may also have another boolean option named --bar
. Now we call the
program like this:
Foo --list first --bar --list "second value" --list 3So
listProperty
will be filled with a List containing {"first", "second value", "3"}.public static final CliContainerStyle COMMA_SEPARATED
CliOption
or CliArgument
may occur only once. Multiple values are supplied as comma separated
list. In the above example call the program as following:
Foo --list "first,second value,3" --bar
AbstractValueConverterToContainer
public static CliContainerStyle[] values()
for (CliContainerStyle c : CliContainerStyle.values()) System.out.println(c);
public static CliContainerStyle valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2001–2016 mmm-Team. All rights reserved.