Class RequiredUnlessEnvironmentRestriction

    • Field Detail

      • variables

        private final java.util.List<java.lang.String> variables
    • Constructor Detail

      • RequiredUnlessEnvironmentRestriction

        public RequiredUnlessEnvironmentRestriction​(java.lang.String[] envVars)
    • Method Detail

      • unless

        protected <T> boolean unless​(ParseState<T> state,
                                     OptionMetadata option)
        Description copied from class: AbstractRequiredUnlessRestriction
        Answers whether the unless condition of the restriction is met

        If the unless condition is met then the restriction will not require the option to be present.

        Specified by:
        unless in class AbstractRequiredUnlessRestriction
        Type Parameters:
        T - Command Type
        Parameters:
        state - Parse state
        option - Option Metadata
        Returns:
        True if unless condition met, false otherwise
      • unless

        protected <T> boolean unless​(ParseState<T> state,
                                     ArgumentsMetadata arguments)
        Description copied from class: AbstractRequiredUnlessRestriction
        Answers whether the unless condition of the restriction is met

        If the unless condition is met then the restriction will not require arguments to be present.

        Specified by:
        unless in class AbstractRequiredUnlessRestriction
        Type Parameters:
        T - Command Type
        Parameters:
        state - Parse state
        arguments - Arguments Metadata
        Returns:
        True if unless condition met, false otherwise
      • getPreamble

        public java.lang.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 java.lang.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