Class MessageUrlParser
java.lang.Object
dev.sympho.modular_commands.utils.parse.EntityUrlParser<Message>
dev.sympho.modular_commands.utils.parse.MessageUrlParser
- All Implemented Interfaces:
ParserFunction<String,,Message> UrlParser<Message>,BiFunction<CommandContext,String, Mono<Message>>
A parser for message URLs.
- Since:
- 1.0
- Version:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.sympho.modular_commands.utils.parse.UrlParser
UrlParser.Choice<T extends @NonNull Object>, UrlParser.ChoiceBase<T extends @NonNull Object,P extends UrlParser<T>>, UrlParser.PostParser<I extends @NonNull Object, T extends @NonNull Object, P1 extends @NonNull UrlParser<I>, P2 extends @NonNull ParserFunction<I, T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparsePath(GatewayDiscordClient client, String path) Parses the URL path.typeName()Gets the display name for this type.protected booleanChecks if the given path (endpoint) is valid for the entity type of this parser.Methods inherited from class dev.sympho.modular_commands.utils.parse.EntityUrlParser
parse, supportsMethods 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
-
Constructor Details
-
MessageUrlParser
public MessageUrlParser()Creates a new instance.
-
-
Method Details
-
typeName
Description copied from class:EntityUrlParserGets the display name for this type.- Specified by:
typeNamein classEntityUrlParser<Message>- Returns:
- The name.
-
validPath
Description copied from class:EntityUrlParserChecks if the given path (endpoint) is valid for the entity type of this parser.- Specified by:
validPathin classEntityUrlParser<Message>- Parameters:
path- The path.- Returns:
- If the path is valid for this parser.
-
parsePath
Description copied from class:EntityUrlParserParses the URL path.- Specified by:
parsePathin classEntityUrlParser<Message>- Parameters:
client- The Discord client.path- The path.- Returns:
- The parsed entity, or
nullif the path is not valid.
-