Class StringArgument<C>
- java.lang.Object
-
- cloud.commandframework.arguments.CommandArgument<C,java.lang.String>
-
- cloud.commandframework.arguments.standard.StringArgument<C>
-
- All Implemented Interfaces:
java.lang.Comparable<CommandArgument<?,?>>
public final class StringArgument<C> extends CommandArgument<C,java.lang.String>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStringArgument.Builder<C>static classStringArgument.StringModestatic classStringArgument.StringParseExceptionstatic classStringArgument.StringParser<C>
-
Method Summary
Modifier and Type Method Description @NonNull StringArgument.StringModegetStringMode()Get the string modestatic <C> @NonNull CommandArgument<C,java.lang.String>greedy(@NonNull java.lang.String name)Create a new required command argument with the 'greedy' parsing modestatic <C> @NonNull StringArgument.Builder<C>newBuilder(@NonNull java.lang.String name)Create a new builderstatic <C> @NonNull CommandArgument<C,java.lang.String>of(@NonNull java.lang.String name)Create a new required single string command argumentstatic <C> @NonNull CommandArgument<C,java.lang.String>of(@NonNull java.lang.String name, @NonNull StringArgument.StringMode stringMode)Create a new required command argumentstatic <C> @NonNull CommandArgument<C,java.lang.String>optional(@NonNull java.lang.String name)Create a new optional single string command argumentstatic <C> @NonNull CommandArgument<C,java.lang.String>optional(@NonNull java.lang.String name, @NonNull StringArgument.StringMode stringMode)Create a new optional command argumentstatic <C> @NonNull CommandArgument<C,java.lang.String>optional(@NonNull java.lang.String name, @NonNull java.lang.String defaultString)Create a new required command argument with a default valuestatic <C> @NonNull CommandArgument<C,java.lang.String>quoted(@NonNull java.lang.String name)Create a new required command argument with the 'quoted' parsing modestatic <C> @NonNull CommandArgument<C,java.lang.String>single(@NonNull java.lang.String name)Create a new required command argument with the 'single' parsing mode-
Methods inherited from class cloud.commandframework.arguments.CommandArgument
addPreprocessor, compareTo, copy, equals, getDefaultValue, getName, getOwningCommand, getParser, getSuggestionsProvider, getValueType, hasDefaultValue, hashCode, isArgumentRegistered, isRequired, ofType, ofType, preprocess, setArgumentRegistered, setOwningCommand, toString
-
-
-
-
Method Detail
-
newBuilder
public static <C> @NonNull StringArgument.Builder<C> newBuilder(@NonNull java.lang.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,java.lang.String> of(@NonNull java.lang.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,java.lang.String> of(@NonNull java.lang.String name, @NonNull StringArgument.StringMode stringMode)
Create a new required command argument- Type Parameters:
C- Command sender type- Parameters:
name- Argument namestringMode- String mode- Returns:
- Created argument
-
optional
public static <C> @NonNull CommandArgument<C,java.lang.String> optional(@NonNull java.lang.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,java.lang.String> optional(@NonNull java.lang.String name, @NonNull StringArgument.StringMode stringMode)
Create a new optional command argument- Type Parameters:
C- Command sender type- Parameters:
name- Argument namestringMode- String mode- Returns:
- Created argument
-
optional
public static <C> @NonNull CommandArgument<C,java.lang.String> optional(@NonNull java.lang.String name, @NonNull java.lang.String defaultString)
Create a new required command argument with a default value- Type Parameters:
C- Command sender type- Parameters:
name- Argument namedefaultString- Default string- Returns:
- Created argument
-
single
public static <C> @NonNull CommandArgument<C,java.lang.String> single(@NonNull java.lang.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,java.lang.String> greedy(@NonNull java.lang.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
-
quoted
public static <C> @NonNull CommandArgument<C,java.lang.String> quoted(@NonNull java.lang.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
-
-