Module com.github.rvesse.airline
Class AbstractAllowedValuesRestriction
- java.lang.Object
-
- com.github.rvesse.airline.restrictions.AbstractCommonRestriction
-
- com.github.rvesse.airline.restrictions.common.AbstractAllowedValuesRestriction
-
- All Implemented Interfaces:
HelpHint,ArgumentsRestriction,OptionRestriction
- Direct Known Subclasses:
AllowedEnumValuesRestriction,AllowedRawValuesRestriction,AllowedValuesRestriction
public abstract class AbstractAllowedValuesRestriction extends AbstractCommonRestriction implements HelpHint
-
-
Field Summary
Fields Modifier and Type Field Description protected static booleanCASE_INSENSITIVEprotected static booleanCASE_SENSITIVEprotected booleancaseInsensitiveprotected java.util.Set<java.lang.String>rawValues
-
Constructor Summary
Constructors Constructor Description AbstractAllowedValuesRestriction(boolean caseInsensitive)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static java.util.Set<java.lang.Object>asObjects(java.util.Set<java.lang.String> set)java.util.Set<java.lang.String>getAllowedValues()java.lang.String[]getContentBlock(int blockNumber)Gets the content block with the given numberHelpFormatgetFormat()Gets the format of the provided help informationjava.lang.StringgetPreamble()Gets the preamble text that should be includedintnumContentBlocks()Gets the number of content blocks provided-
Methods inherited from class com.github.rvesse.airline.restrictions.AbstractCommonRestriction
finalValidate, finalValidate, getArgumentTitle, getArgumentTitle, getOptionTitle, postValidate, postValidate, preValidate, preValidate
-
-
-
-
Field Detail
-
CASE_SENSITIVE
protected static final boolean CASE_SENSITIVE
- See Also:
- Constant Field Values
-
CASE_INSENSITIVE
protected static final boolean CASE_INSENSITIVE
- See Also:
- Constant Field Values
-
rawValues
protected final java.util.Set<java.lang.String> rawValues
-
caseInsensitive
protected final boolean caseInsensitive
-
-
Method Detail
-
asObjects
protected static java.util.Set<java.lang.Object> asObjects(java.util.Set<java.lang.String> set)
-
getPreamble
public java.lang.String getPreamble()
Description copied from interface:HelpHintGets the preamble text that should be included- Specified by:
getPreamblein interfaceHelpHint- Returns:
- Preamble text
-
getFormat
public HelpFormat getFormat()
Description copied from interface:HelpHintGets the format of the provided help information
-
numContentBlocks
public int numContentBlocks()
Description copied from interface:HelpHintGets the number of content blocks providedHelp generators should consult the
HelpHint.getFormat()return value to determine how to format the content blocks but they are not required to do so- Specified by:
numContentBlocksin interfaceHelpHint- Returns:
- Number of content blocks
-
getContentBlock
public java.lang.String[] getContentBlock(int blockNumber)
Description copied from interface:HelpHintGets the content block with the given number- Specified by:
getContentBlockin interfaceHelpHint- Parameters:
blockNumber- Block number- Returns:
- Content Block
-
getAllowedValues
public java.util.Set<java.lang.String> getAllowedValues()
-
-