Class UserRefMentionParser
java.lang.Object
dev.sympho.modular_commands.utils.parse.entity.EntityRefMentionParser<EntityRef.UserRef>
dev.sympho.modular_commands.utils.parse.entity.UserRefMentionParser
- All Implemented Interfaces:
ParserFunction<String,,EntityRef.UserRef> BiFunction<CommandContext,String, Mono<EntityRef.UserRef>>
A parser for user mentions to references.
- 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.UserRefmakeRef(CommandContext context, Snowflake id) Creates the reference.protected booleanprefixMatches(String prefix) Determines if the mention prefix matches the expected type.protected StringtypeName()Gets the display name for this type.Methods inherited from class dev.sympho.modular_commands.utils.parse.entity.EntityRefMentionParser
parse, parseId, parseRefMethods 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
-
UserRefMentionParser
public UserRefMentionParser()Creates a new instance.
-
-
Method Details
-
prefixMatches
Description copied from class:EntityRefMentionParserDetermines if the mention prefix matches the expected type.- Specified by:
prefixMatchesin classEntityRefMentionParser<EntityRef.UserRef>- Parameters:
prefix- The detected prefix.- Returns:
trueif the prefix matches the expected,falseotherwise.
-
makeRef
Description copied from class:EntityRefMentionParserCreates the reference.- Specified by:
makeRefin classEntityRefMentionParser<EntityRef.UserRef>- Parameters:
context- The execution context.id- The parsed ID.- Returns:
- The created reference.
-
typeName
Description copied from class:EntityRefMentionParserGets the display name for this type.- Specified by:
typeNamein classEntityRefMentionParser<EntityRef.UserRef>- Returns:
- The name.
-