-
- Type Parameters:
V
- type of the containedvalue
.
- All Known Implementing Classes:
AbstractCliProperty
,CliBooleanProperty
,CliClassListProperty
,CliClassProperty
,CliCollectionProperty
,CliFlagProperty
,CliListProperty
,CliLocalDateProperty
,CliLocaleListProperty
,CliLocaleProperty
,CliLocalTimeProperty
,CliLongListProperty
,CliLongProperty
,CliSetProperty
,CliStringListProperty
,CliStringProperty
public interface CliProperty<V>
Interface for a property configured viaCliArgument
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description V
get()
default String
getAsString()
Localizable
getHelp()
default String
getName()
List<String>
getNames()
Class<V>
getValueClass()
default boolean
isEmpty()
boolean
isMandatory()
boolean
isOption()
default boolean
isValid()
void
set(V value)
void
setFromString(String value)
default void
validate()
Validates thevalue
of this property.
-
-
-
Method Detail
-
getHelp
Localizable getHelp()
- Returns:
- the
Localizable
describing thisCliProperty
.
-
getName
default String getName()
- Returns:
- the canonical name of this
CliProperty
.
-
isOption
boolean isOption()
- Returns:
true
if thisCliProperty
is an option (corresponds to aCliOption
),false
otherwise (if a parameter).
-
isMandatory
boolean isMandatory()
- Returns:
true
if required,false
otherwise.
-
isValid
default boolean isValid()
- Returns:
true
if the value of this property is valid,false
otherwise.
-
isEmpty
default boolean isEmpty()
- Returns:
true
if thevalue
of this property is empty (e.g.null
),false
otherwise.
-
get
V get()
- Returns:
- the current value.
-
set
void set(V value)
- Parameters:
value
- the new value.
-
setFromString
void setFromString(String value)
- Parameters:
value
- the new value asString
to parse.
-
validate
default void validate()
Validates thevalue
of this property.- Throws:
RuntimeException
- if the value is invalid.
-
-