Class CommandFlag.Builder<T>

java.lang.Object
cloud.commandframework.arguments.flags.CommandFlag.Builder<T>
Enclosing class:
CommandFlag<T>

public static final class CommandFlag.Builder<T> extends Object
  • Method Details

    • withAliases

      public CommandFlag.Builder<T> withAliases(@NonNull String... aliases)
      Create a new builder instance using the given flag aliases. These may at most be one character in length
      Parameters:
      aliases - Flag aliases
      Returns:
      New builder instance
    • withDescription

      @Deprecated public CommandFlag.Builder<T> withDescription(@NonNull Description description)
      Deprecated.
      for removal since 1.4.0. Use withDescription(ArgumentDescription) instead.
      Create a new builder instance using the given flag description
      Parameters:
      description - Flag description
      Returns:
      New builder instance
    • withDescription

      public CommandFlag.Builder<T> withDescription(@NonNull ArgumentDescription description)
      d Create a new builder instance using the given flag description
      Parameters:
      description - Flag description
      Returns:
      New builder instance
      Since:
      1.4.0
    • withArgument

      public <N> CommandFlag.Builder<N> withArgument(@NonNull CommandArgument<?,​N> argument)
      Create a new builder instance using the given command argument
      Type Parameters:
      N - New argument type
      Parameters:
      argument - Command argument
      Returns:
      New builder instance
    • withArgument

      public <N> CommandFlag.Builder<N> withArgument(@NonNull CommandArgument.Builder<?,​N> builder)
      Create a new builder instance using the given command argument
      Type Parameters:
      N - New argument type
      Parameters:
      builder - Command argument builder. CommandArgument.Builder.build() will be invoked.
      Returns:
      New builder instance
    • build

      public @NonNull CommandFlag<T> build()
      Build a new command flag instance
      Returns:
      Constructed instance