Class UrlParser.Choice<T extends @NonNull Object>

java.lang.Object
dev.sympho.modular_commands.utils.parse.UrlParser.ChoiceBase<T,UrlParser<T>>
dev.sympho.modular_commands.utils.parse.UrlParser.Choice<T>
Type Parameters:
T - The parsed argument type.
All Implemented Interfaces:
ParserFunction<String,T>, UrlParser<T>, BiFunction<CommandContext,String,Mono<T>>
Enclosing interface:
UrlParser<T extends @NonNull Object>

public static class UrlParser.Choice<T extends @NonNull Object> extends UrlParser.ChoiceBase<T,UrlParser<T>>
Parser that supports multiple URL types by delegating to one of a list of parsers. Note that this includes compatibility checks.
Since:
1.0
API Note:
This is a convenience subtype of UrlParser.ChoiceBase with the second parameter already set.
  • Constructor Details

    • Choice

      public Choice(Function<URL,@Nullable UrlParser<T>> parserMapper)
      Creates a new instance.
      Parameters:
      parserMapper - The function to use to determine which parser to delegate to for a given URL.