public final class SuggestionsBuilder
extends java.lang.Object
| Constructor and Description |
|---|
SuggestionsBuilder() |
| Modifier and Type | Method and Description |
|---|---|
@NotNull @Unmodifiable java.util.List<java.lang.String> |
build()
Builds the list of suggestions.
|
void |
clear()
Clears all current suggestions.
|
int |
count()
Returns the number of suggestions currently stored.
|
void |
setFilter(@Nullable java.util.function.Predicate<java.lang.String> filter)
Sets a filter for suggestions.
|
void |
suggest(@NotNull java.lang.String suggestion)
Adds a suggestion.
|
boolean |
testFilter(@NotNull java.lang.String suggestion)
Tests if a suggestion passes the current filter.
|
public boolean testFilter(@NotNull
@NotNull java.lang.String suggestion)
suggestion - the suggestion to testpublic void setFilter(@Nullable
@Nullable java.util.function.Predicate<java.lang.String> filter)
Only suggestions that pass the filter will be included in the final list.
filter - the filter predicate, or null to accept all suggestionspublic void clear()
public void suggest(@NotNull
@NotNull java.lang.String suggestion)
If the suggestion already exists, it will not be added again.
suggestion - the suggestion to addpublic int count()
@NotNull public @NotNull @Unmodifiable java.util.List<java.lang.String> build()