java.lang.Object
dev.sympho.modular_commands.utils.parse.entity.EntityRefUrlParser<EntityRef.ChannelRef<C>>
dev.sympho.modular_commands.utils.parse.entity.ChannelRefUrlParser<C>
- Type Parameters:
C- The channel type.
- All Implemented Interfaces:
ParserFunction<String,,EntityRef.ChannelRef<C>> UrlParser<EntityRef.ChannelRef<C>>,BiFunction<CommandContext,String, Mono<EntityRef.ChannelRef<C>>>
public class ChannelRefUrlParser<C extends @NonNull Channel>
extends EntityRefUrlParser<EntityRef.ChannelRef<C>>
A reference parser for channel 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 TypeMethodDescriptionprotected @Nullable EntityRef.ChannelRef<C>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.entity.EntityRefUrlParser
parse, parse, 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
-
ChannelRefUrlParser
Creates a new instance.- Parameters:
type- The type of channel.
-
-
Method Details
-
typeName
Description copied from class:EntityRefUrlParserGets the display name for this type.- Specified by:
typeNamein classEntityRefUrlParser<EntityRef.ChannelRef<C extends @NonNull Channel>>- Returns:
- The name.
-
validPath
Description copied from class:EntityRefUrlParserChecks if the given path (endpoint) is valid for the entity type of this parser.- Specified by:
validPathin classEntityRefUrlParser<EntityRef.ChannelRef<C extends @NonNull Channel>>- Parameters:
path- The path.- Returns:
- If the path is valid for this parser.
-
parsePath
Description copied from class:EntityRefUrlParserParses the URL path.- Specified by:
parsePathin classEntityRefUrlParser<EntityRef.ChannelRef<C extends @NonNull Channel>>- Parameters:
path- The path.- Returns:
- The parsed entity, or
nullif the path is not valid.
-