Class GeoHashPrecision

java.lang.Object
co.elastic.clients.elasticsearch._types.GeoHashPrecision
All Implemented Interfaces:
JsonpSerializable, TaggedUnion<GeoHashPrecision.Kind,​java.lang.Object>

@JsonpDeserializable
public class GeoHashPrecision
extends java.lang.Object
implements TaggedUnion<GeoHashPrecision.Kind,​java.lang.Object>, JsonpSerializable
A precision that can be expressed as a geohash length between 1 and 12, or a distance measure like "1km", "10m".
See Also:
API specification
  • Field Details

  • Method Details

    • _kind

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

      public final java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<GeoHashPrecision.Kind,​java.lang.Object>
    • _toJsonString

      public java.lang.String _toJsonString()
    • of

      public static GeoHashPrecision of​(java.util.function.Function<GeoHashPrecision.Builder,​ObjectBuilder<GeoHashPrecision>> fn)
    • isGeohashLength

      public boolean isGeohashLength()
      Is this variant instance of kind geohash_length?
    • geohashLength

      public java.lang.Number geohashLength()
      Get the geohash_length variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geohash_length kind.
    • isDistance

      public boolean isDistance()
      Is this variant instance of kind distance?
    • distance

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

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