Class FieldSuggester
- java.lang.Object
-
- org.opensearch.client.opensearch.core.search.FieldSuggester
-
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<FieldSuggester.Kind,java.lang.Object>
@JsonpDeserializable public class FieldSuggester extends java.lang.Object implements TaggedUnion<FieldSuggester.Kind,java.lang.Object>, JsonpSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldSuggester.Builderstatic classFieldSuggester.KindFieldSuggestervariant kinds.
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<FieldSuggester>_DESERIALIZER
-
Constructor Summary
Constructors Constructor Description FieldSuggester(FieldSuggesterVariant value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object_get()FieldSuggester.Kind_kind()Get the of the kind of variant held by this object.CompletionSuggestercompletion()Get thecompletionvariant value.booleanisCompletion()Is this variant instance of kindcompletion?booleanisPhrase()Is this variant instance of kindphrase?booleanisPrefix()Is this variant instance of kindprefix?booleanisRegex()Is this variant instance of kindregex?booleanisTerm()Is this variant instance of kindterm?booleanisText()Is this variant instance of kindtext?static FieldSuggesterof(java.util.function.Function<FieldSuggester.Builder,ObjectBuilder<FieldSuggester>> fn)PhraseSuggesterphrase()Get thephrasevariant value.java.lang.Stringprefix()Get theprefixvariant value.java.lang.Stringregex()Get theregexvariant value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)protected static voidsetupFieldSuggesterDeserializer(ObjectDeserializer<FieldSuggester.Builder> op)TermSuggesterterm()Get thetermvariant value.java.lang.Stringtext()Get thetextvariant value.
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<FieldSuggester> _DESERIALIZER
-
-
Constructor Detail
-
FieldSuggester
public FieldSuggester(FieldSuggesterVariant value)
-
-
Method Detail
-
_kind
public final FieldSuggester.Kind _kind()
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<FieldSuggester.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()
- Specified by:
_getin interfaceTaggedUnion<FieldSuggester.Kind,java.lang.Object>
-
of
public static FieldSuggester of(java.util.function.Function<FieldSuggester.Builder,ObjectBuilder<FieldSuggester>> fn)
-
isCompletion
public boolean isCompletion()
Is this variant instance of kindcompletion?
-
completion
public CompletionSuggester 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 PhraseSuggester phrase()
Get thephrasevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thephrasekind.
-
isPrefix
public boolean isPrefix()
Is this variant instance of kindprefix?
-
prefix
public java.lang.String prefix()
Get theprefixvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theprefixkind.
-
isRegex
public boolean isRegex()
Is this variant instance of kindregex?
-
regex
public java.lang.String regex()
Get theregexvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theregexkind.
-
isTerm
public boolean isTerm()
Is this variant instance of kindterm?
-
term
public TermSuggester term()
Get thetermvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetermkind.
-
isText
public boolean isText()
Is this variant instance of kindtext?
-
text
public java.lang.String text()
Get thetextvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetextkind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
setupFieldSuggesterDeserializer
protected static void setupFieldSuggesterDeserializer(ObjectDeserializer<FieldSuggester.Builder> op)
-
-