Class SuggestOption<TDocument>
- java.lang.Object
-
- org.opensearch.client.opensearch.core.search.SuggestOption<TDocument>
-
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<SuggestOption.Kind,java.lang.Object>
public class SuggestOption<TDocument> extends java.lang.Object implements TaggedUnion<SuggestOption.Kind,java.lang.Object>, JsonpSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSuggestOption.Builder<TDocument>static classSuggestOption.Kind
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object_get()SuggestOption.Kind_kind()Get the of the kind of variant held by this object.CompletionSuggestOption<TDocument>completion()Get thecompletionvariant value.static <TDocument>
JsonpDeserializer<SuggestOption<TDocument>>createSuggestOptionDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)booleanisCompletion()Is this variant instance of kindcompletion?booleanisPhrase()Is this variant instance of kindphrase?booleanisTerm()Is this variant instance of kindterm?static <TDocument>
SuggestOption<TDocument>of(java.util.function.Function<SuggestOption.Builder<TDocument>,ObjectBuilder<SuggestOption<TDocument>>> fn)PhraseSuggestOptionphrase()Get thephrasevariant value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)TermSuggestOptionterm()Get thetermvariant value.
-
-
-
Method Detail
-
_kind
public final SuggestOption.Kind _kind()
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<SuggestOption.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()
- Specified by:
_getin interfaceTaggedUnion<SuggestOption.Kind,java.lang.Object>
-
of
public static <TDocument> SuggestOption<TDocument> of(java.util.function.Function<SuggestOption.Builder<TDocument>,ObjectBuilder<SuggestOption<TDocument>>> fn)
-
isCompletion
public boolean isCompletion()
Is this variant instance of kindcompletion?
-
completion
public CompletionSuggestOption<TDocument> completion()
Get thecompletionvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thecompletionkind.
-
isPhrase
public boolean isPhrase()
Is this variant instance of kindphrase?
-
phrase
public PhraseSuggestOption phrase()
Get thephrasevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thephrasekind.
-
isTerm
public boolean isTerm()
Is this variant instance of kindterm?
-
term
public TermSuggestOption term()
Get thetermvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetermkind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
createSuggestOptionDeserializer
public static <TDocument> JsonpDeserializer<SuggestOption<TDocument>> createSuggestOptionDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
-
-