Class ChannelRefMentionParser<C extends Channel>
java.lang.Object
dev.sympho.modular_commands.utils.parse.entity.EntityRefMentionParser<EntityRef.ChannelRef<C>>
dev.sympho.modular_commands.utils.parse.entity.ChannelRefMentionParser<C>
- Type Parameters:
C- The channel type.
- All Implemented Interfaces:
ParserFunction<String,,EntityRef.ChannelRef<C>> BiFunction<CommandContext,String, Mono<EntityRef.ChannelRef<C>>>
public class ChannelRefMentionParser<C extends Channel>
extends EntityRefMentionParser<EntityRef.ChannelRef<C>>
A parser for channel 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.ChannelRef<C>makeRef(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
-
ChannelRefMentionParser
Creates a new instance.- Parameters:
type- The type of channel.
-
-
Method Details
-
prefixMatches
Description copied from class:EntityRefMentionParserDetermines if the mention prefix matches the expected type.- Specified by:
prefixMatchesin classEntityRefMentionParser<EntityRef.ChannelRef<C extends Channel>>- 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.ChannelRef<C extends Channel>>- 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.ChannelRef<C extends Channel>>- Returns:
- The name.
-