Class SuggestOption<TDocument>
java.lang.Object
co.elastic.clients.elasticsearch.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
- See Also:
- API specification
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSuggestOption.Builder<TDocument>static classSuggestOption.Kind -
Method Summary
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
_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
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
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
Get thetermvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetermkind.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-
createSuggestOptionDeserializer
public static <TDocument> JsonpDeserializer<SuggestOption<TDocument>> createSuggestOptionDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
-