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 class
SuggestOption.Builder<TDocument>
static class
SuggestOption.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 thecompletion
variant value.static <TDocument>
JsonpDeserializer<SuggestOption<TDocument>>createSuggestOptionDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
boolean
isCompletion()
Is this variant instance of kindcompletion
?boolean
isPhrase()
Is this variant instance of kindphrase
?boolean
isTerm()
Is this variant instance of kindterm
?static <TDocument>
SuggestOption<TDocument>of(java.util.function.Function<SuggestOption.Builder<TDocument>,ObjectBuilder<SuggestOption<TDocument>>> fn)
PhraseSuggestOption
phrase()
Get thephrase
variant value.void
serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
TermSuggestOption
term()
Get theterm
variant 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:TaggedUnion
Get the of the kind of variant held by this object.- Specified by:
_kind
in interfaceTaggedUnion<SuggestOption.Kind,java.lang.Object>
- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()- Specified by:
_get
in 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 thecompletion
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thecompletion
kind.
-
isPhrase
public boolean isPhrase()Is this variant instance of kindphrase
? -
phrase
Get thephrase
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thephrase
kind.
-
isTerm
public boolean isTerm()Is this variant instance of kindterm
? -
term
Get theterm
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of theterm
kind.
-
serialize
- Specified by:
serialize
in interfaceJsonpSerializable
-
createSuggestOptionDeserializer
public static <TDocument> JsonpDeserializer<SuggestOption<TDocument>> createSuggestOptionDeserializer(JsonpDeserializer<TDocument> tDocumentDeserializer)
-