Class SortOptions

java.lang.Object
co.elastic.clients.elasticsearch._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
See Also:
Documentation on elastic.co, API specification
  • Field Details

  • Constructor Details

  • Method Details

    • _kind

      public final SortOptions.Kind _kind()
      Description copied from interface: TaggedUnion
      Get the of the kind of variant held by this object.
      Specified by:
      _kind in interface TaggedUnion<SortOptions.Kind,​java.lang.Object>
      Returns:
      the variant kind
    • _get

      public final java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<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 _score variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the _score kind.
    • isDoc

      public boolean isDoc()
      Is this variant instance of kind _doc?
    • doc

      public ScoreSort doc()
      Get the _doc variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the _doc kind.
    • isGeoDistance

      public boolean isGeoDistance()
      Is this variant instance of kind _geo_distance?
    • geoDistance

      public GeoDistanceSort geoDistance()
      Get the _geo_distance variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the _geo_distance kind.
    • isScript

      public boolean isScript()
      Is this variant instance of kind _script?
    • script

      public ScriptSort script()
      Get the _script variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the _script kind.
    • isField

      public boolean isField()
      Is this variant instance of kind field?
    • field

      public FieldSort field()
      Get the field variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the field kind.
    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable