Class RegexPreprocessor<C>
java.lang.Object
cloud.commandframework.arguments.preprocessor.RegexPreprocessor<C>
- Type Parameters:
C
- Command sender type
- All Implemented Interfaces:
BiFunction<@NonNull CommandContext<C>,
@NonNull Queue<@NonNull String>, @NonNull ArgumentParseResult<Boolean>>
@API(status=STABLE)
public final class RegexPreprocessor<C>
extends Object
implements BiFunction<@NonNull CommandContext<C>,@NonNull Queue<@NonNull String>,@NonNull ArgumentParseResult<Boolean>>
Command preprocessor that filters based on regular expressions
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Exception thrown when input fails regex matching inRegexPreprocessor
-
Method Summary
Modifier and TypeMethodDescription@NonNull ArgumentParseResult<Boolean>
apply
(@NonNull CommandContext<C> context, @NonNull Queue<@NonNull String> strings) static <C> @NonNull RegexPreprocessor<C>
Create a new preprocessor usingStandardCaptionKeys.ARGUMENT_PARSE_FAILURE_REGEX
as the failure captionstatic <C> @NonNull RegexPreprocessor<C>
Create a new preprocessorMethods 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
-
Method Details
-
of
Create a new preprocessor usingStandardCaptionKeys.ARGUMENT_PARSE_FAILURE_REGEX
as the failure caption- Type Parameters:
C
- Command sender type- Parameters:
pattern
- Regular expression- Returns:
- Preprocessor instance
-
apply
public @NonNull ArgumentParseResult<Boolean> apply(@NonNull CommandContext<C> context, @NonNull Queue<@NonNull String> strings) - Specified by:
apply
in interfaceBiFunction<@NonNull CommandContext<C>,
@NonNull Queue<@NonNull String>, @NonNull ArgumentParseResult<Boolean>>
-