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>allowedValuesprivate java.lang.ObjectcurrentState-
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> voidpostValidate(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> voidpostValidate(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:OptionRestrictionMethod that is called after Airline has converted a string argument received into a strongly typed Java value- Specified by:
postValidatein interfaceOptionRestriction- Overrides:
postValidatein 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:ArgumentsRestrictionMethod that is called after Airline has converted a string argument received into a strongly typed Java value- Specified by:
postValidatein interfaceArgumentsRestriction- Overrides:
postValidatein classAbstractCommonRestriction- Parameters:
state- Parser statearguments- Arguments meta-datavalue- Strongly typed value
-
-