- Type Parameters:
T- The type of argument that is provided.R- The type of raw argument that is received.
- All Superinterfaces:
BiFunction<CommandContext,,R, Mono<T>> ParserFunction<R,T>
- Enclosing class:
- Parsers
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface Parsers.Functor<R extends @NonNull Object,T extends @NonNull Object>
extends ParserFunction<R,T>
A parser that does not depend on the invocation context.
- Since:
- 1.0
- Version:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.sympho.modular_commands.api.command.parameter.parse.ParserFunction
ParserFunction.PostParser<R extends @NonNull Object,I extends @NonNull Object, T extends @NonNull Object, P1 extends @NonNull ParserFunction<R, I>, P2 extends @NonNull ParserFunction<I, T>> -
Method Summary
Methods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface dev.sympho.modular_commands.api.command.parameter.parse.ParserFunction
apply, then
-
Method Details
-
parse
Parses the given raw argument from the user into the corresponding value.- Parameters:
raw- The raw argument received from the user.- Returns:
- A Mono that issues the parsed argument. If the raw value is invalid, it may
fail with a
InvalidArgumentException. - Throws:
InvalidArgumentException- if the given argument is not a valid value.
-
parse
Description copied from interface:ParserFunctionParses the given raw argument from the user into the corresponding value.- Specified by:
parsein interfaceParserFunction<R extends @NonNull Object,T extends @NonNull Object> - Parameters:
context- The execution context.raw- The raw argument received from the user.- Returns:
- A Mono that issues the parsed argument. If the raw value is invalid, it may
fail with a
InvalidArgumentException. May be empty, in which case the value defers to thedefault(functionally the same as if the argument was missing, but without causing an error if the parameter isrequired). - Throws:
InvalidArgumentException- if the given argument is not a valid value.
-