-
- 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 Vget()default StringgetAsString()LocalizablegetHelp()default StringgetName()List<String>getNames()Class<V>getValueClass()default booleanisEmpty()booleanisMandatory()booleanisOption()default booleanisValid()voidset(V value)voidsetFromString(String value)default voidvalidate()Validates thevalueof this property.
-
-
-
Method Detail
-
getHelp
Localizable getHelp()
- Returns:
- the
Localizabledescribing thisCliProperty.
-
getName
default String getName()
- Returns:
- the canonical name of this
CliProperty.
-
isOption
boolean isOption()
- Returns:
trueif thisCliPropertyis an option (corresponds to aCliOption),falseotherwise (if a parameter).
-
isMandatory
boolean isMandatory()
- Returns:
trueif required,falseotherwise.
-
isValid
default boolean isValid()
- Returns:
trueif the value of this property is valid,falseotherwise.
-
isEmpty
default boolean isEmpty()
- Returns:
trueif thevalueof this property is empty (e.g.null),falseotherwise.
-
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 asStringto parse.
-
validate
default void validate()
Validates thevalueof this property.- Throws:
RuntimeException- if the value is invalid.
-
-