Interface ValueParameter.Simple<T>

    • Method Detail

      • parseValue

        Optional<? extends T> parseValue​(CommandCause commandCause,
                                         ArgumentReader.Mutable reader)
                                  throws ArgumentParseException
        Gets the value for this parameter.

        This should have no side effects on anything except on the state of the ArgumentReader.

        This element may return nothing in the form of an empty optional. This indicates that a parse succeeded, but no meaningful value was returned.

        Parameters:
        commandCause - The cause of this parse
        reader - The ArgumentReader that contains the unparsed arguments
        Returns:
        Returns the value(s)
        Throws:
        ArgumentParseException - if a parameter could not be parsed
      • complete

        List<CommandCompletion> complete​(CommandCause context,
                                         String currentInput)
        Gets valid completions for this element, given the supplied CommandCause and current input for this element.
        Parameters:
        context - The CommandCause that contains the parsed arguments
        currentInput - The current input for this argument
        Returns:
        The list of values
      • complete

        default List<CommandCompletion> complete​(CommandContext context,
                                                 String currentInput)
        This should not be overridden by implementations of this class. If you wish to do so, implement ValueParameter instead. Gets valid completions for this element, given the supplied CommandContext and current input for this element.
        Specified by:
        complete in interface ValueCompleter
        Parameters:
        context - The CommandContext that contains the parsed arguments
        currentInput - The current input for this argument
        Returns:
        The list of values