Class Suggestion<TDocument>
java.lang.Object
co.elastic.clients.elasticsearch.core.search.Suggestion<TDocument>
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<Suggestion.Kind,SuggestionVariant>
public class Suggestion<TDocument>
extends Object
implements TaggedUnion<Suggestion.Kind,SuggestionVariant>, JsonpSerializable
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal SuggestionVariant_get()final Suggestion.Kind_kind()Get the of the kind of variant held by this object.Get thecompletionvariant value.static <TDocument>
ExternallyTaggedUnion.TypedKeysDeserializer<Suggestion<TDocument>>createSuggestionDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer) Create a JSON deserializer for SuggestionbooleanIs this variant instance of kindcompletion?booleanisPhrase()Is this variant instance of kindphrase?booleanisTerm()Is this variant instance of kindterm?static <TDocument>
Suggestion<TDocument>of(Function<Suggestion.Builder<TDocument>, ObjectBuilder<Suggestion<TDocument>>> fn) phrase()Get thephrasevariant value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) term()Get thetermvariant value.toString()
-
Constructor Details
-
Suggestion
-
-
Method Details
-
_kind
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<Suggestion.Kind,SuggestionVariant> - Returns:
- the variant kind
-
_get
- Specified by:
_getin interfaceTaggedUnion<Suggestion.Kind,SuggestionVariant>
-
of
public static <TDocument> Suggestion<TDocument> of(Function<Suggestion.Builder<TDocument>, ObjectBuilder<Suggestion<TDocument>>> fn) -
isCompletion
public boolean isCompletion()Is this variant instance of kindcompletion? -
completion
Get thecompletionvariant value.- Throws:
IllegalStateException- if the current variant is not of thecompletionkind.
-
isPhrase
public boolean isPhrase()Is this variant instance of kindphrase? -
phrase
Get thephrasevariant value.- Throws:
IllegalStateException- if the current variant is not of thephrasekind.
-
isTerm
public boolean isTerm()Is this variant instance of kindterm? -
term
Get thetermvariant value.- Throws:
IllegalStateException- if the current variant is not of thetermkind.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-
toString
-
createSuggestionDeserializer
public static <TDocument> ExternallyTaggedUnion.TypedKeysDeserializer<Suggestion<TDocument>> createSuggestionDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer) Create a JSON deserializer for Suggestion
-