Class FunctorUrlParser.ChoiceBase<T extends @NonNull Object,P extends FunctorUrlParser<T>>
java.lang.Object
dev.sympho.modular_commands.utils.parse.UrlParser.ChoiceBase<T,P>
dev.sympho.modular_commands.utils.parse.FunctorUrlParser.ChoiceBase<T,P>
- Type Parameters:
T
- The parsed argument type.P
- The delegate parser type.
- All Implemented Interfaces:
ParserFunction<String,
,T> FunctorUrlParser<T>
,UrlParser<T>
,BiFunction<CommandContext,
String, Mono<T>>
- Direct Known Subclasses:
FunctorUrlParser.Choice
- Enclosing interface:
- FunctorUrlParser<T extends @NonNull Object>
public abstract static class FunctorUrlParser.ChoiceBase<T extends @NonNull Object,P extends FunctorUrlParser<T>>
extends UrlParser.ChoiceBase<T,P>
implements FunctorUrlParser<T>
Base for a parser that supports multiple URL types by delegating to one of a list of
parsers. Note that this includes
compatibility checks
.- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.sympho.modular_commands.utils.parse.FunctorUrlParser
FunctorUrlParser.Choice<T extends @NonNull Object>, FunctorUrlParser.ChoiceBase<T extends @NonNull Object,
P extends FunctorUrlParser<T>>, FunctorUrlParser.PostParser<I extends @NonNull Object, T extends @NonNull Object, P1 extends @NonNull FunctorUrlParser<I>, P2 extends @NonNull Parsers.Functor<I, T>> 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
ConstructorsModifierConstructorDescriptionprotected
ChoiceBase
(Function<URL, @Nullable P> parserMapper) Creates a new instance. -
Method Summary
Methods inherited from class dev.sympho.modular_commands.utils.parse.UrlParser.ChoiceBase
getParser, parse, supports
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
Methods inherited from interface dev.sympho.modular_commands.utils.parse.FunctorUrlParser
parse, then
Methods inherited from interface dev.sympho.modular_commands.api.command.parameter.parse.ParserFunction
apply
-
Constructor Details
-
ChoiceBase
Creates a new instance.- Parameters:
parserMapper
- The function to use to determine which parser to delegate to for a given URL.
-
-
Method Details
-
parse
Description copied from interface:FunctorUrlParser
Parses the given URL.- Specified by:
parse
in interfaceFunctorUrlParser<T extends @NonNull Object>
- Parameters:
url
- The URL to parse.- Returns:
- The parsed value. May result in a
InvalidArgumentException
if the URL is invalid. - Throws:
InvalidArgumentException
- if the URL is invalid.
-