Package org.incendo.cloud.suggestion
Class FilteringSuggestionProcessor<C>
java.lang.Object
org.incendo.cloud.suggestion.FilteringSuggestionProcessor<C>
- Type Parameters:
C- command sender type
- All Implemented Interfaces:
SuggestionProcessor<C>
@API(status=STABLE)
public final class FilteringSuggestionProcessor<C>
extends Object
implements SuggestionProcessor<C>
Command suggestion processor filters suggestions based on the remaining unconsumed input in the
queue.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFilter function that tests (and potentially changes) each suggestion against the input and context. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newFilteringSuggestionProcessorfiltering withFilteringSuggestionProcessor.Filter.partialTokenMatches(boolean)that ignores case.Create a newFilteringSuggestionProcessor. -
Method Summary
Modifier and TypeMethodDescriptionprocess(@NonNull CommandPreprocessingContext<C> context, @NonNull Stream<@NonNull Suggestion> suggestions) Adds operations to thesuggestionsstreamand returns the result.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.incendo.cloud.suggestion.SuggestionProcessor
then
-
Constructor Details
-
FilteringSuggestionProcessor
Create a newFilteringSuggestionProcessorfiltering withFilteringSuggestionProcessor.Filter.partialTokenMatches(boolean)that ignores case. -
FilteringSuggestionProcessor
@API(status=STABLE) public FilteringSuggestionProcessor(@NonNull FilteringSuggestionProcessor.Filter<C> filter) Create a newFilteringSuggestionProcessor.- Parameters:
filter- mode
-
-
Method Details
-
process
public @NonNull Stream<@NonNull Suggestion> process(@NonNull CommandPreprocessingContext<C> context, @NonNull Stream<@NonNull Suggestion> suggestions) Description copied from interface:SuggestionProcessorAdds operations to thesuggestionsstreamand returns the result.- Specified by:
processin interfaceSuggestionProcessor<C>- Parameters:
context- command preprocessing context which can be used to access the command context and command inputsuggestions- the suggestions to process- Returns:
- the processed suggestions
-