Package org.incendo.cloud.suggestion
Interface FilteringSuggestionProcessor.Filter.Simple<C>
- Type Parameters:
C- command sender type
- All Superinterfaces:
FilteringSuggestionProcessor.Filter<C>
- Enclosing interface:
FilteringSuggestionProcessor.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)
@FunctionalInterface
public static interface FilteringSuggestionProcessor.Filter.Simple<C>
extends FilteringSuggestionProcessor.Filter<C>
Simple version of
FilteringSuggestionProcessor.Filter which doesn't modify suggestions.
Returns boolean instead of nullable String.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.incendo.cloud.suggestion.FilteringSuggestionProcessor.Filter
FilteringSuggestionProcessor.Filter.Simple<C> -
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull FilteringSuggestionProcessor.Filter.Simple<C> contextFree(@NonNull BiPredicate<String, String> test) Create a new context-freeFilteringSuggestionProcessor.Filter.Simple.filter(@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 org.incendo.cloud.suggestion.FilteringSuggestionProcessor.Filter
and
-
Method Details
-
test
@API(status=STABLE) 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
-
filter
default @Nullable String filter(@NonNull CommandPreprocessingContext<C> context, @NonNull String suggestion, @NonNull String input) Description copied from interface:FilteringSuggestionProcessor.FilterFilters a potential suggestion against the input and context.- Specified by:
filterin interfaceFilteringSuggestionProcessor.Filter<C>- Parameters:
context- contextsuggestion- potential suggestioninput- remaining unconsumed input- Returns:
- possibly modified suggestion or null to deny
-
contextFree
@API(status=STABLE) static <C> @NonNull FilteringSuggestionProcessor.Filter.Simple<C> contextFree(@NonNull BiPredicate<String, String> test) Create a new context-freeFilteringSuggestionProcessor.Filter.Simple.- Type Parameters:
C- sender type- Parameters:
test- predicate- Returns:
- simple filter
-