Class Suggest<TDocument>
java.lang.Object
org.opensearch.client.opensearch.core.search.Suggest<TDocument>
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<Suggest.Kind,SuggestVariant>
public class Suggest<TDocument>
extends Object
implements TaggedUnion<Suggest.Kind,SuggestVariant>, JsonpSerializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal SuggestVariant_get()final Suggest.Kind_kind()Get the of the kind of variant held by this object.Get thecompletionvariant value.static <TDocument>
ExternallyTaggedUnion.TypedKeysDeserializer<Suggest<TDocument>> createSuggestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer) booleanIs this variant instance of kindcompletion?booleanisPhrase()Is this variant instance of kindphrase?booleanisTerm()Is this variant instance of kindterm?static <TDocument>
Suggest<TDocument> of(Function<Suggest.Builder<TDocument>, ObjectBuilder<Suggest<TDocument>>> fn) phrase()Get thephrasevariant value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) term()Get thetermvariant value.
-
Constructor Details
-
Suggest
-
-
Method Details
-
_kind
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<Suggest.Kind,SuggestVariant> - Returns:
- the variant kind
-
_get
- Specified by:
_getin interfaceTaggedUnion<Suggest.Kind,SuggestVariant>
-
of
public static <TDocument> Suggest<TDocument> of(Function<Suggest.Builder<TDocument>, ObjectBuilder<Suggest<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
-
createSuggestDeserializer
public static <TDocument> ExternallyTaggedUnion.TypedKeysDeserializer<Suggest<TDocument>> createSuggestDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
-