Package cloud.commandframework.execution
Interface FilteringCommandSuggestionProcessor.Filter.Simple<C>
- Type Parameters:
C- sender type
- All Superinterfaces:
FilteringCommandSuggestionProcessor.Filter<C>
- Enclosing interface:
- FilteringCommandSuggestionProcessor.Filter<C>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@API(status=STABLE,
since="1.8.0")
@FunctionalInterface
public static interface FilteringCommandSuggestionProcessor.Filter.Simple<C>
extends FilteringCommandSuggestionProcessor.Filter<C>
Simple version of
FilteringCommandSuggestionProcessor.Filter which doesn't modify suggestions.
Returns boolean instead of nullable String.
- Since:
- 1.8.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface cloud.commandframework.execution.FilteringCommandSuggestionProcessor.Filter
FilteringCommandSuggestionProcessor.Filter.Simple<C> -
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull FilteringCommandSuggestionProcessor.Filter.Simple<C>contextFree(@NonNull BiPredicate<String, String> test) Create a new context-freeFilteringCommandSuggestionProcessor.Filter.Simple.default @Nullable Stringfilter(@NonNull CommandPreprocessingContext<C> context, @NonNull String suggestion, @NonNull String input) Filters a potential suggestion against the input and context.booleantest(@NonNull CommandPreprocessingContext<C> context, @NonNull String suggestion, @NonNull String input) Tests a suggestion against the context and input.Methods inherited from interface cloud.commandframework.execution.FilteringCommandSuggestionProcessor.Filter
and, andTrimBeforeLastSpace
-
Method Details
-
test
@API(status=STABLE, since="1.8.0") boolean test(@NonNull CommandPreprocessingContext<C> context, @NonNull String suggestion, @NonNull String input) Tests a suggestion against the context and input.- Parameters:
context- contextsuggestion- potential suggestioninput- remaining unconsumed input- Returns:
- whether to accept the suggestion
- Since:
- 1.8.0
-
filter
default @Nullable String filter(@NonNull CommandPreprocessingContext<C> context, @NonNull String suggestion, @NonNull String input) Description copied from interface:FilteringCommandSuggestionProcessor.FilterFilters a potential suggestion against the input and context.- Specified by:
filterin interfaceFilteringCommandSuggestionProcessor.Filter<C>- Parameters:
context- contextsuggestion- potential suggestioninput- remaining unconsumed input- Returns:
- possibly modified suggestion or null to deny
-
contextFree
@API(status=STABLE, since="1.8.0") static <C> @NonNull FilteringCommandSuggestionProcessor.Filter.Simple<C> contextFree(@NonNull BiPredicate<String, String> test) Create a new context-freeFilteringCommandSuggestionProcessor.Filter.Simple.- Type Parameters:
C- sender type- Parameters:
test- predicate- Returns:
- simple filter
- Since:
- 1.8.0
-