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 Details

    • CASE_SENSITIVE

      protected static final boolean CASE_SENSITIVE
      See Also:
    • CASE_INSENSITIVE

      protected static final boolean CASE_INSENSITIVE
      See Also:
    • rawValues

      protected final Set<String> rawValues
    • caseInsensitive

      protected final boolean caseInsensitive
  • Constructor Details

    • AbstractAllowedValuesRestriction

      public AbstractAllowedValuesRestriction(boolean caseInsensitive)
  • Method Details

    • asObjects

      protected static Set<Object> asObjects(Set<String> set)
    • getPreamble

      public String getPreamble()
      Description copied from interface: HelpHint
      Gets the preamble text that should be included
      Specified by:
      getPreamble in interface HelpHint
      Returns:
      Preamble text
    • getFormat

      public HelpFormat getFormat()
      Description copied from interface: HelpHint
      Gets the format of the provided help information
      Specified by:
      getFormat in interface HelpHint
      Returns:
      Help format
    • numContentBlocks

      public int numContentBlocks()
      Description copied from interface: HelpHint
      Gets the number of content blocks provided

      Help 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:
      numContentBlocks in interface HelpHint
      Returns:
      Number of content blocks
    • getContentBlock

      public String[] getContentBlock(int blockNumber)
      Description copied from interface: HelpHint
      Gets the content block with the given number
      Specified by:
      getContentBlock in interface HelpHint
      Parameters:
      blockNumber - Block number
      Returns:
      Content Block
    • getAllowedValues

      public Set<String> getAllowedValues()