Class StringArgument<C>

java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,String>
cloud.commandframework.arguments.standard.StringArgument<C>
All Implemented Interfaces:
CloudKeyHolder<String>, Comparable<CommandArgument<?,?>>

@API(status=STABLE) public final class StringArgument<C> extends CommandArgument<C,String>
  • Method Details

    • newBuilder

      public static <C> @NonNull StringArgument.Builder<C> newBuilder(@NonNull String name)
      Create a new builder
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Name of the argument
      Returns:
      Created builder
    • of

      public static <C> @NonNull CommandArgument<C,String> of(@NonNull String name)
      Create a new required single string command argument
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
    • of

      public static <C> @NonNull CommandArgument<C,String> of(@NonNull String name, @NonNull StringArgument.StringMode stringMode)
      Create a new required command argument
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      stringMode - String mode
      Returns:
      Created argument
    • optional

      public static <C> @NonNull CommandArgument<C,String> optional(@NonNull String name)
      Create a new optional single string command argument
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
    • optional

      public static <C> @NonNull CommandArgument<C,String> optional(@NonNull String name, @NonNull StringArgument.StringMode stringMode)
      Create a new optional command argument
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      stringMode - String mode
      Returns:
      Created argument
    • optional

      public static <C> @NonNull CommandArgument<C,String> optional(@NonNull String name, @NonNull String defaultString)
      Create a new required command argument with a default value
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      defaultString - Default string
      Returns:
      Created argument
    • single

      public static <C> @NonNull CommandArgument<C,String> single(@NonNull String name)
      Create a new required command argument with the 'single' parsing mode
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
    • greedy

      public static <C> @NonNull CommandArgument<C,String> greedy(@NonNull String name)
      Create a new required command argument with the 'greedy' parsing mode
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
    • greedyFlagYielding

      @API(status=STABLE, since="1.7.0") public static <C> @NonNull CommandArgument<C,String> greedyFlagYielding(@NonNull String name)
      Create a new required command argument with the 'greedy flag yielding' parsing mode
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
      Since:
      1.7.0
    • quoted

      public static <C> @NonNull CommandArgument<C,String> quoted(@NonNull String name)
      Create a new required command argument with the 'quoted' parsing mode
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
    • getStringMode

      public @NonNull StringArgument.StringMode getStringMode()
      Get the string mode
      Returns:
      String mode