Package org.incendo.cloud.suggestion
Interface SuggestionProcessor<C>
- Type Parameters:
C- command sender type
- All Known Implementing Classes:
FilteringSuggestionProcessor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Processor that operates on the
stream of suggestions before it is collected
for the suggestion result passed to platform implementations or other callers.-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull SuggestionProcessor<C> Creates aSuggestionProcessorthat simply returns the input suggestions.process(@NonNull CommandPreprocessingContext<C> context, @NonNull Stream<@NonNull Suggestion> suggestions) Adds operations to thesuggestionsstreamand returns the result.default @NonNull SuggestionProcessor<C> then(@NonNull SuggestionProcessor<C> nextProcessor)
-
Method Details
-
passThrough
Creates aSuggestionProcessorthat simply returns the input suggestions.- Type Parameters:
C- command sender type- Returns:
- the processor
-
process
@NonNull Stream<@NonNull Suggestion> process(@NonNull CommandPreprocessingContext<C> context, @NonNull Stream<@NonNull Suggestion> suggestions) Adds operations to thesuggestionsstreamand returns the result.- 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
-
then
- Parameters:
nextProcessor- next suggestion processor- Returns:
- chained processor
-