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
ConstructorsModifierConstructorDescriptionprotectedChoiceBase(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, 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.utils.parse.FunctorUrlParser
parse, thenMethods 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:FunctorUrlParserParses the given URL.- Specified by:
parsein interfaceFunctorUrlParser<T extends @NonNull Object>- Parameters:
url- The URL to parse.- Returns:
- The parsed value. May result in a
InvalidArgumentExceptionif the URL is invalid. - Throws:
InvalidArgumentException- if the URL is invalid.
-