Package top.focess.qq.api.command
Class CommandArgument<V>
- java.lang.Object
-
- top.focess.qq.api.command.CommandArgument<V>
-
- Type Parameters:
V- the type of the argument.
public class CommandArgument<V> extends Object
Represents a command argument.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CommandArgument<String>of(String value)Represents a CommandArgument with a specific String value Note: this argument indicates this position is a known String value.static <V> CommandArgument<V>of(DataConverter<V> defaultDataConverter)Represents an unknown CommandArgument with a specific DataConverter Note: this argument indicates this position need a V type valuestatic <V> CommandArgument<V>of(DataConverter<V> dataConverter, V value)Represents a CommandArgument with a specific value Note: this argument indicates this position is a known V value.static CommandArgument<Integer>ofInt()Represents an unknown Int CommandArgument Note: this argument indicates this position need an Int value.static CommandArgument<Long>ofLong()Represent an unknown Long CommandArgument Note: this argument indicates this position need a Long value.static <V> CommandArgument<V>ofNullable(DataConverter<V> dataConverter)Represents a nullable CommandArgument with a specific DataConverter Note: this argument indicates this position is a nullable value.static CommandArgument<String>ofString()Represent an unknown String CommandArgument Note: this argument indicates this position need a String value.
-
-
-
Method Detail
-
ofString
@NotNull @Contract(value=" -> new", pure=true) public static CommandArgument<String> ofString()Represent an unknown String CommandArgument Note: this argument indicates this position need a String value.- Returns:
- the CommandArgument representing an unknown String
-
ofLong
@NotNull @Contract(value=" -> new", pure=true) public static CommandArgument<Long> ofLong()Represent an unknown Long CommandArgument Note: this argument indicates this position need a Long value.- Returns:
- the CommandArgument representing an unknown Long
-
ofInt
@NotNull @Contract(value=" -> new", pure=true) public static CommandArgument<Integer> ofInt()Represents an unknown Int CommandArgument Note: this argument indicates this position need an Int value.- Returns:
- the CommandArgument representing an unknown Int
-
of
@NotNull @Contract(value="_ -> new", pure=true) public static <V> CommandArgument<V> of(DataConverter<V> defaultDataConverter)Represents an unknown CommandArgument with a specific DataConverter Note: this argument indicates this position need a V type value- Type Parameters:
V- the type of the argument.- Parameters:
defaultDataConverter- the DataConverter- Returns:
- the CommandArgument representing an unknown CommandArgument with a specific DataConverter
-
of
@NotNull public static CommandArgument<String> of(@NotNull String value)
Represents a CommandArgument with a specific String value Note: this argument indicates this position is a known String value.- Parameters:
value- the String value of the CommandArgument- Returns:
- the CommandArgument with a specific String value
-
of
@NotNull public static <V> CommandArgument<V> of(@NotNull DataConverter<V> dataConverter, @NotNull V value)
Represents a CommandArgument with a specific value Note: this argument indicates this position is a known V value.- Type Parameters:
V- the type of the argument.- Parameters:
dataConverter- the DataConvertervalue- the value of the CommandArgument- Returns:
- the CommandArgument with a specific value
-
ofNullable
@NotNull public static <V> CommandArgument<V> ofNullable(@NotNull DataConverter<V> dataConverter)
Represents a nullable CommandArgument with a specific DataConverter Note: this argument indicates this position is a nullable value.- Type Parameters:
V- the type of the argument.- Parameters:
dataConverter- the DataConverter- Returns:
- the nullable CommandArgument with a specific DataConverter
-
-