Class RoleRefParser
java.lang.Object
dev.sympho.modular_commands.utils.parse.entity.EntityRefParser<EntityRef.RoleRef>
dev.sympho.modular_commands.utils.parse.entity.RoleRefParser
- All Implemented Interfaces:
ParserFunction<String,,EntityRef.RoleRef> BiFunction<CommandContext,String, Mono<EntityRef.RoleRef>>
A parser that extracts a role reference from a string.
- Since:
- 1.0
- Version:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.sympho.modular_commands.api.command.parameter.parse.ParserFunction
ParserFunction.PostParser<R extends @NonNull Object,I extends @NonNull Object, T extends @NonNull Object, P1 extends @NonNull ParserFunction<R, I>, P2 extends @NonNull ParserFunction<I, T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EntityRef.RoleRefmakeRef(CommandContext context, Snowflake id) Creates the reference.parseRef(CommandContext context, String raw) Parses the given string.Methods inherited from class dev.sympho.modular_commands.utils.parse.entity.EntityRefParser
parseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface dev.sympho.modular_commands.api.command.parameter.parse.ParserFunction
apply, then
-
Constructor Details
-
RoleRefParser
public RoleRefParser()Creates a new instance.
-
-
Method Details
-
makeRef
Description copied from class:EntityRefParserCreates the reference.- Specified by:
makeRefin classEntityRefParser<EntityRef.RoleRef>- Parameters:
context- The execution context.id- The parsed ID.- Returns:
- The created reference.
-
parseRef
public EntityRef.RoleRef parseRef(CommandContext context, String raw) throws InvalidArgumentException Description copied from class:EntityRefParserParses the given string.- Overrides:
parseRefin classEntityRefParser<EntityRef.RoleRef>- Parameters:
context- The execution context.raw- The string to parse.- Returns:
- The parsed reference.
- Throws:
InvalidArgumentException- if the given string does not contain a valid reference.
-