Class WrappedBrigadierParser<C,T>
java.lang.Object
cloud.commandframework.brigadier.argument.WrappedBrigadierParser<C,T>
- Type Parameters:
C- the sender typeT- the value type of the argument
- All Implemented Interfaces:
cloud.commandframework.arguments.parser.ArgumentParser<C,T>
public final class WrappedBrigadierParser<C,T>
extends Object
implements cloud.commandframework.arguments.parser.ArgumentParser<C,T>
A wrapped argument parser that can expose Brigadier argument types to the Cloud world.
- Since:
- 1.5.0
-
Field Summary
FieldsFields inherited from interface cloud.commandframework.arguments.parser.ArgumentParser
DEFAULT_ARGUMENT_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionWrappedBrigadierParser(com.mojang.brigadier.arguments.ArgumentType<T> nativeType) Create an argument parser based on a brigadier command.WrappedBrigadierParser(com.mojang.brigadier.arguments.ArgumentType<T> nativeType, int expectedArgumentCount) Create an argument parser based on a brigadier command.WrappedBrigadierParser(Supplier<com.mojang.brigadier.arguments.ArgumentType<T>> nativeType) Create an argument parser based on a brigadier command.WrappedBrigadierParser(Supplier<com.mojang.brigadier.arguments.ArgumentType<T>> nativeType, int expectedArgumentCount) Create an argument parser based on a brigadier command. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.brigadier.arguments.ArgumentType<T>Get the backing BrigadierArgumentTypefor this parser.intboolean@NonNull cloud.commandframework.arguments.parser.ArgumentParseResult<@NonNull T>parse(@NonNull cloud.commandframework.context.CommandContext<@NonNull C> commandContext, @NonNull Queue<@NonNull String> inputQueue) suggestions(@NonNull cloud.commandframework.context.CommandContext<C> commandContext, @NonNull String input) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cloud.commandframework.arguments.parser.ArgumentParser
map
-
Field Details
-
COMMAND_CONTEXT_BRIGADIER_NATIVE_SENDER
- See Also:
-
-
Constructor Details
-
WrappedBrigadierParser
Create an argument parser based on a brigadier command.- Parameters:
nativeType- the native command type- Since:
- 1.5.0
-
WrappedBrigadierParser
Create an argument parser based on a brigadier command.- Parameters:
nativeType- the native command type, computed lazily- Since:
- 1.7.0
-
WrappedBrigadierParser
public WrappedBrigadierParser(com.mojang.brigadier.arguments.ArgumentType<T> nativeType, int expectedArgumentCount) Create an argument parser based on a brigadier command.- Parameters:
nativeType- the native command typeexpectedArgumentCount- the number of arguments the brigadier type is expected to consume- Since:
- 1.5.0
-
WrappedBrigadierParser
public WrappedBrigadierParser(Supplier<com.mojang.brigadier.arguments.ArgumentType<T>> nativeType, int expectedArgumentCount) Create an argument parser based on a brigadier command.- Parameters:
nativeType- the native command type provider, calculated lazilyexpectedArgumentCount- the number of arguments the brigadier type is expected to consume- Since:
- 1.7.0
-
-
Method Details
-
getNativeArgument
Get the backing BrigadierArgumentTypefor this parser.- Returns:
- the argument type
- Since:
- 1.5.0
-
parse
-
suggestions
-
isContextFree
public boolean isContextFree() -
getRequestedArgumentCount
public int getRequestedArgumentCount()
-