Class BuilderOptions<T>

java.lang.Object
redempt.ordinate.builder.BuilderOptions<T>
Type Parameters:
T - The sender type

public class BuilderOptions<T> extends Object
Represents options for a CommandBuilder
  • Constructor Details

    • BuilderOptions

      public BuilderOptions()
  • Method Details

    • getDefaults

      public static <T> BuilderOptions<T> getDefaults()
    • setHelpSubcommandName

      public void setHelpSubcommandName(String name)
      Sets the help subcommand name, specify null for no auto-generated help subcommands
      Parameters:
      name - The auto-generated help subcommand name
    • addType

      public <V> ArgType<T,V> addType(Class<V> clazz, Function<String,V> converter)
      Registers a type for use in builders
      Type Parameters:
      V - The type
      Parameters:
      clazz - The class of the type
      converter - A function to parse the type
      Returns:
      The constructed ArgType, in case you want to apply a completer
    • addType

      public <V> ArgType<T,V> addType(Class<V> clazz, BiFunction<CommandContext<T>,String,V> converter)
      Registers a type for use in builders
      Type Parameters:
      V - The type
      Parameters:
      clazz - The class of the type
      converter - A function to parse the type
      Returns:
      The constructed ArgType, in case you want to apply a completer
    • getType

      public ArgType<T,?> getType(Class<?> clazz)
      Gets the ArgType associated with a class
      Parameters:
      clazz - The class
      Returns:
      The argument type
      Throws:
      IllegalArgumentException - If no argument type for that class exists
    • getHelpSubcommandName

      public String getHelpSubcommandName()
      Returns:
      The name to be used for auto-generated help subcommands