Module com.github.rvesse.airline
Class AllowedValuesRestriction
- java.lang.Object
-
- com.github.rvesse.airline.restrictions.AbstractCommonRestriction
-
- com.github.rvesse.airline.restrictions.common.AbstractAllowedValuesRestriction
-
- com.github.rvesse.airline.restrictions.common.AllowedValuesRestriction
-
- All Implemented Interfaces:
HelpHint
,ArgumentsRestriction
,OptionRestriction
public class AllowedValuesRestriction extends AbstractAllowedValuesRestriction
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.Object>
allowedValues
private java.lang.Object
currentState
-
Fields inherited from class com.github.rvesse.airline.restrictions.common.AbstractAllowedValuesRestriction
CASE_INSENSITIVE, CASE_SENSITIVE, caseInsensitive, rawValues
-
-
Constructor Summary
Constructors Constructor Description AllowedValuesRestriction(java.lang.String... rawValues)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> java.util.Set<java.lang.Object>
createAllowedValues(ParseState<T> state, java.lang.String title, java.lang.Class<?> type, TypeConverter converter)
<T> void
postValidate(ParseState<T> state, ArgumentsMetadata arguments, java.lang.Object value)
Method that is called after Airline has converted a string argument received into a strongly typed Java value<T> void
postValidate(ParseState<T> state, OptionMetadata option, java.lang.Object value)
Method that is called after Airline has converted 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, preValidate, preValidate
-
-
-
-
Method Detail
-
postValidate
public <T> void postValidate(ParseState<T> state, OptionMetadata option, java.lang.Object value)
Description copied from interface:OptionRestriction
Method that is called after Airline has converted a string argument received into a strongly typed Java value- Specified by:
postValidate
in interfaceOptionRestriction
- Overrides:
postValidate
in classAbstractCommonRestriction
- Parameters:
state
- Parser stateoption
- Option meta-datavalue
- Strongly typed value
-
createAllowedValues
protected <T> java.util.Set<java.lang.Object> createAllowedValues(ParseState<T> state, java.lang.String title, java.lang.Class<?> type, TypeConverter converter)
-
postValidate
public <T> void postValidate(ParseState<T> state, ArgumentsMetadata arguments, java.lang.Object value)
Description copied from interface:ArgumentsRestriction
Method that is called after Airline has converted a string argument received into a strongly typed Java value- Specified by:
postValidate
in interfaceArgumentsRestriction
- Overrides:
postValidate
in classAbstractCommonRestriction
- Parameters:
state
- Parser statearguments
- Arguments meta-datavalue
- Strongly typed value
-
-