Class SortOptions
- java.lang.Object
-
- org.opensearch.client.opensearch._types.SortOptions
-
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<SortOptions.Kind,java.lang.Object>
@JsonpDeserializable public class SortOptions extends java.lang.Object implements TaggedUnion<SortOptions.Kind,java.lang.Object>, JsonpSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSortOptions.Builderstatic classSortOptions.KindSortOptionsvariant kinds.
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<SortOptions>_DESERIALIZER
-
Constructor Summary
Constructors Constructor Description SortOptions(SortOptionsVariant value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object_get()SortOptions.Kind_kind()Get the of the kind of variant held by this object.ScoreSortdoc()Get the_docvariant value.FieldSortfield()Get thefieldvariant value.GeoDistanceSortgeoDistance()Get the_geo_distancevariant value.booleanisDoc()Is this variant instance of kind_doc?booleanisField()Is this variant instance of kindfield?booleanisGeoDistance()Is this variant instance of kind_geo_distance?booleanisScore()Is this variant instance of kind_score?booleanisScript()Is this variant instance of kind_script?static SortOptionsof(java.util.function.Function<SortOptions.Builder,ObjectBuilder<SortOptions>> fn)ScoreSortscore()Get the_scorevariant value.ScriptSortscript()Get the_scriptvariant value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<SortOptions> _DESERIALIZER
-
-
Constructor Detail
-
SortOptions
public SortOptions(SortOptionsVariant value)
-
-
Method Detail
-
_kind
public final SortOptions.Kind _kind()
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<SortOptions.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()
- Specified by:
_getin interfaceTaggedUnion<SortOptions.Kind,java.lang.Object>
-
of
public static SortOptions of(java.util.function.Function<SortOptions.Builder,ObjectBuilder<SortOptions>> fn)
-
isScore
public boolean isScore()
Is this variant instance of kind_score?
-
score
public ScoreSort score()
Get the_scorevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of the_scorekind.
-
isDoc
public boolean isDoc()
Is this variant instance of kind_doc?
-
doc
public ScoreSort doc()
Get the_docvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of the_dockind.
-
isGeoDistance
public boolean isGeoDistance()
Is this variant instance of kind_geo_distance?
-
geoDistance
public GeoDistanceSort geoDistance()
Get the_geo_distancevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of the_geo_distancekind.
-
isScript
public boolean isScript()
Is this variant instance of kind_script?
-
script
public ScriptSort script()
Get the_scriptvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of the_scriptkind.
-
isField
public boolean isField()
Is this variant instance of kindfield?
-
field
public FieldSort field()
Get thefieldvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thefieldkind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
-