Module com.github.rvesse.airline
Class AllowedEnumValuesRestriction
- java.lang.Object
-
- com.github.rvesse.airline.restrictions.AbstractCommonRestriction
-
- com.github.rvesse.airline.restrictions.common.AbstractAllowedValuesRestriction
-
- com.github.rvesse.airline.restrictions.common.AllowedEnumValuesRestriction
-
- All Implemented Interfaces:
HelpHint
,ArgumentsRestriction
,OptionRestriction
public class AllowedEnumValuesRestriction extends AbstractAllowedValuesRestriction
-
-
Field Summary
-
Fields inherited from class com.github.rvesse.airline.restrictions.common.AbstractAllowedValuesRestriction
CASE_INSENSITIVE, CASE_SENSITIVE, caseInsensitive, rawValues
-
-
Constructor Summary
Constructors Constructor Description AllowedEnumValuesRestriction(java.lang.Class<? extends java.lang.Enum<?>> cls)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.Collection<java.lang.String>
getValues(java.lang.Class<? extends java.lang.Enum<?>> cls)
<T> void
preValidate(ParseState<T> state, ArgumentsMetadata arguments, java.lang.String value)
Method that is called before Airline attempts to convert a string argument received into a strongly typed Java value<T> void
preValidate(ParseState<T> state, OptionMetadata option, java.lang.String value)
Method that is called before Airline attempts to convert a string argument received into a strongly typed Java value-
Methods inherited from class com.github.rvesse.airline.restrictions.common.AbstractAllowedValuesRestriction
asObjects, getAllowedValues, getContentBlock, getFormat, getPreamble, numContentBlocks
-
Methods inherited from class com.github.rvesse.airline.restrictions.AbstractCommonRestriction
finalValidate, finalValidate, getArgumentTitle, getArgumentTitle, getOptionTitle, postValidate, postValidate
-
-
-
-
Method Detail
-
getValues
private java.util.Collection<java.lang.String> getValues(java.lang.Class<? extends java.lang.Enum<?>> cls)
-
preValidate
public <T> void preValidate(ParseState<T> state, OptionMetadata option, java.lang.String value)
Description copied from interface:OptionRestriction
Method that is called before Airline attempts to convert a string argument received into a strongly typed Java value- Specified by:
preValidate
in interfaceOptionRestriction
- Overrides:
preValidate
in classAbstractCommonRestriction
- Parameters:
state
- Parser stateoption
- Option meta-datavalue
- String value
-
preValidate
public <T> void preValidate(ParseState<T> state, ArgumentsMetadata arguments, java.lang.String value)
Description copied from interface:ArgumentsRestriction
Method that is called before Airline attempts to convert a string argument received into a strongly typed Java value- Specified by:
preValidate
in interfaceArgumentsRestriction
- Overrides:
preValidate
in classAbstractCommonRestriction
- Parameters:
state
- Parser statearguments
- Arguments meta-datavalue
- String value
-
-