Interface ComponentPreprocessor<C>
- All Known Implementing Classes:
RegexPreprocessor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionpreprocess(@NonNull CommandContext<C> context, @NonNull CommandInput commandInput) Pre-processes the associated component.static <C> @NonNull ComponentPreprocessor<C> wrap(@NonNull BiFunction<@NonNull CommandContext<C>, @NonNull CommandInput, @NonNull ArgumentParseResult<Boolean>> function) Wraps the givenfunctionin a preprocessor.
-
Method Details
-
wrap
static <C> @NonNull ComponentPreprocessor<C> wrap(@NonNull BiFunction<@NonNull CommandContext<C>, @NonNull CommandInput, @NonNull ArgumentParseResult<Boolean>> function) Wraps the givenfunctionin a preprocessor.- Type Parameters:
C- the command sender type- Parameters:
function- the function- Returns:
- the wrapped function
-
preprocess
@NonNull ArgumentParseResult<Boolean> preprocess(@NonNull CommandContext<C> context, @NonNull CommandInput commandInput) Pre-processes the associated component.If the preprocessor fails then the command parsing will fail immediately.
- Parameters:
context- the command contextcommandInput- the current command input- Returns:
- the result
-