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<?,
?>>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static enum
static final class
static final class
Nested classes/interfaces inherited from class cloud.commandframework.arguments.CommandArgument
CommandArgument.TypedBuilder<C,
T, B extends CommandArgument.Builder<C, T>> -
Method Summary
Modifier and TypeMethodDescription@NonNull StringArgument.StringMode
Get the string modestatic <C> @NonNull CommandArgument<C,
String> Create a new required command argument with the 'greedy' parsing modestatic <C> @NonNull CommandArgument<C,
String> greedyFlagYielding
(@NonNull String name) Create a new required command argument with the 'greedy flag yielding' parsing modestatic <C> @NonNull StringArgument.Builder<C>
newBuilder
(@NonNull String name) Create a new builderstatic <C> @NonNull CommandArgument<C,
String> Create a new required single string command argumentstatic <C> @NonNull CommandArgument<C,
String> of
(@NonNull String name, @NonNull StringArgument.StringMode stringMode) Create a new required command argumentstatic <C> @NonNull CommandArgument<C,
String> Create a new optional single string command argumentstatic <C> @NonNull CommandArgument<C,
String> optional
(@NonNull String name, @NonNull StringArgument.StringMode stringMode) Create a new optional command argumentstatic <C> @NonNull CommandArgument<C,
String> Create a new required command argument with a default valuestatic <C> @NonNull CommandArgument<C,
String> Create a new required command argument with the 'quoted' parsing modestatic <C> @NonNull CommandArgument<C,
String> Create a new required command argument with the 'single' parsing modeMethods inherited from class cloud.commandframework.arguments.CommandArgument
addPreprocessor, compareTo, copy, equals, getDefaultDescription, getDefaultValue, getKey, getName, getOwningCommand, getParser, getSuggestionsProvider, getValueType, hasDefaultValue, hashCode, isArgumentRegistered, isRequired, ofType, ofType, preprocess, setArgumentRegistered, setOwningCommand, toString
-
Method Details
-
newBuilder
Create a new builder- Type Parameters:
C
- Command sender type- Parameters:
name
- Name of the argument- Returns:
- Created builder
-
of
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 namestringMode
- String mode- Returns:
- Created argument
-
optional
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 namestringMode
- 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 namedefaultString
- Default string- Returns:
- Created argument
-
single
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
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
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
Get the string mode- Returns:
- String mode
-