Class CommandContext.Builder

java.lang.Object
dev.polv.taleapi.command.CommandContext.Builder
Enclosing class:
CommandContext

public static final class CommandContext.Builder extends Object
Builder for constructing CommandContext instances.
  • Method Details

    • withArgument

      public CommandContext.Builder withArgument(String name, Object value)
      Adds a parsed argument to the context.
      Parameters:
      name - the argument name
      value - the parsed value
      Returns:
      this builder
    • withArguments

      public CommandContext.Builder withArguments(Map<String,Object> args)
      Adds all arguments from a map to the context.
      Parameters:
      args - the arguments to add
      Returns:
      this builder
    • withCommand

      public CommandContext.Builder withCommand(Command command)
      Sets the command being executed.
      Parameters:
      command - the command
      Returns:
      this builder
    • build

      public CommandContext build()
      Builds the CommandContext.
      Returns:
      the constructed CommandContext