public final class SimpleRichSuggestionsBuilder extends java.lang.Object implements RichSuggestionsBuilder
| Constructor and Description |
|---|
SimpleRichSuggestionsBuilder(@NotNull java.lang.String input,
int start) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(@NotNull RichSuggestionsBuilder other)
Adds all suggestions from another builder instance.
|
@NotNull @Unmodifiable java.util.List<java.lang.String> |
build() |
@NotNull RichSuggestionsBuilder |
createOffset(int start)
Creates a new builder view with the given replacement offset.
|
void |
flushLegacy()
Flushes legacy suggestions into this builder.
|
@NotNull java.lang.String |
input()
Returns the full input used for suggestion generation.
|
@NotNull SuggestionsBuilder |
legacyView()
Returns the legacy string-only builder view.
|
@NotNull java.lang.String |
remaining()
Returns the remaining input segment from
RichSuggestionsBuilder.start(). |
@NotNull java.lang.String |
remainingLowerCase()
Returns the lowercase remaining input segment from
RichSuggestionsBuilder.start(). |
@NotNull RichSuggestionsBuilder |
restart()
Creates a new builder view that restarts at this builder's start offset.
|
void |
setFilter(java.util.function.Predicate<java.lang.String> filter)
Sets the suggestion filter.
|
int |
start()
Returns the start offset where suggestions should replace text.
|
void |
suggest(int value)
Adds an integer suggestion.
|
void |
suggest(@NotNull java.lang.String text)
Adds a string suggestion.
|
boolean |
testFilter(@NotNull java.lang.String suggestion)
Tests whether a suggestion passes the current filter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsuggest, suggestpublic SimpleRichSuggestionsBuilder(@NotNull
@NotNull java.lang.String input,
int start)
@NotNull public @NotNull java.lang.String input()
RichSuggestionsBuilderinput in interface RichSuggestionsBuilderpublic int start()
RichSuggestionsBuilderstart in interface RichSuggestionsBuilder@NotNull public @NotNull java.lang.String remaining()
RichSuggestionsBuilderRichSuggestionsBuilder.start().remaining in interface RichSuggestionsBuilder@NotNull public @NotNull java.lang.String remainingLowerCase()
RichSuggestionsBuilderRichSuggestionsBuilder.start().remainingLowerCase in interface RichSuggestionsBuilderpublic void suggest(@NotNull
@NotNull java.lang.String text)
RichSuggestionsBuildersuggest in interface RichSuggestionsBuildertext - the suggested textpublic void suggest(int value)
RichSuggestionsBuildersuggest in interface RichSuggestionsBuildervalue - the suggested valuepublic void add(@NotNull
@NotNull RichSuggestionsBuilder other)
RichSuggestionsBuilderadd in interface RichSuggestionsBuilderother - the builder to merge from@NotNull public @NotNull RichSuggestionsBuilder createOffset(int start)
RichSuggestionsBuildercreateOffset in interface RichSuggestionsBuilderstart - the replacement start offset@NotNull public @NotNull RichSuggestionsBuilder restart()
RichSuggestionsBuilderrestart in interface RichSuggestionsBuilder@NotNull public @NotNull SuggestionsBuilder legacyView()
RichSuggestionsBuilderlegacyView in interface RichSuggestionsBuilderpublic boolean testFilter(@NotNull
@NotNull java.lang.String suggestion)
RichSuggestionsBuildertestFilter in interface RichSuggestionsBuildersuggestion - the suggestion to testpublic void setFilter(java.util.function.Predicate<java.lang.String> filter)
RichSuggestionsBuilderOnly suggestions that pass this filter will be included.
setFilter in interface RichSuggestionsBuilderfilter - the filter predicate, or null to accept all suggestionspublic void flushLegacy()
RichSuggestionsBuilderflushLegacy in interface RichSuggestionsBuilder@NotNull public @NotNull @Unmodifiable java.util.List<java.lang.String> build()