Interface VariableValueParameters.DynamicChoicesBuilder<T>

    • Method Detail

      • choicesAndResults

        VariableValueParameters.DynamicChoicesBuilder<T> choicesAndResults​(java.util.function.Supplier<java.util.Map<java.lang.String,​? extends T>> choices)
        Sets the parameter to get its choices from the supplied Map, where each choice is associated with its own object.
        Parameters:
        choices - A supplier that returns an appropriate map.
        Returns:
        This builder, for chaining
      • choices

        VariableValueParameters.DynamicChoicesBuilder<T> choices​(java.util.function.Supplier<? extends java.util.Collection<java.lang.String>> choices)
        Sets the parameter to get its choices from the supplied Collection.
        Parameters:
        choices - A supplier that returns the appropriate choices.
        Returns:
        This builder, for chaining
      • results

        VariableValueParameters.DynamicChoicesBuilder<T> results​(java.util.function.Function<java.lang.String,​? extends T> results)
        Sets the function which defines what result is returned for a specified choice.
        Parameters:
        results - A function that returns the appropriate object for the provided choice
        Returns:
        This builder, for chaining
      • showInUsage

        VariableValueParameters.DynamicChoicesBuilder<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