Interface VariableValueParameters.StaticChoicesBuilder<T>

    • Method Detail

      • addChoice

        default VariableValueParameters.StaticChoicesBuilder<T> addChoice​(java.lang.String choice,
                                                                          T returnedObject)
        Adds a choice to the parameter, along with the object that would be returned if the choice is selected.
        Parameters:
        choice - The string to be matched
        returnedObject - The to return
        Returns:
        This builder, for chaining
      • addChoices

        default VariableValueParameters.StaticChoicesBuilder<T> addChoices​(java.util.Map<java.lang.String,​? extends T> choices)
        Adds a collection of choices to the parameter, along with the objects that would be returned if the associated choice is selected.
        Parameters:
        choices - A Map containing the choices and associated objects.
        Returns:
        This builder, for chaining
      • addChoices

        VariableValueParameters.StaticChoicesBuilder<T> addChoices​(java.lang.Iterable<java.lang.String> choices,
                                                                   java.util.function.Supplier<? extends T> returnedObjectSupplier)
        Adds a collection of choices to the parameter, along with a Supplier that will return an object if one of the choices is selected.
        Parameters:
        choices - The valid choices
        returnedObjectSupplier - Supplies the object to return
        Returns:
        This builder, for chaining
      • showInUsage

        VariableValueParameters.StaticChoicesBuilder<T> showInUsage​(boolean showInUsage)
        Sets what should happen if the usage of this parameter is requested.

        If there are 5 or fewer choices available, and "showInUsage" is true, the choices will be shown in the command usage. Otherwise, the usage will only display only the key.

        Parameters:
        showInUsage - true if the choices should be shown
        Returns:
        This builder, for chaining