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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GeoHashPrecision.Builder
static class
GeoHashPrecision.Kind
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<GeoHashPrecision>
_DESERIALIZER
-
Method Summary
Modifier and Type Method Description java.lang.Object
_get()
GeoHashPrecision.Kind
_kind()
Get the of the kind of variant held by this object.java.lang.String
_toJsonString()
java.lang.String
distance()
Get thedistance
variant value.java.lang.Number
geohashLength()
Get thegeohash_length
variant value.boolean
isDistance()
Is this variant instance of kinddistance
?boolean
isGeohashLength()
Is this variant instance of kindgeohash_length
?static GeoHashPrecision
of(java.util.function.Function<GeoHashPrecision.Builder,ObjectBuilder<GeoHashPrecision>> fn)
void
serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
_DESERIALIZER
-
-
Method Details
-
_kind
Description copied from interface:TaggedUnion
Get the of the kind of variant held by this object.- Specified by:
_kind
in interfaceTaggedUnion<GeoHashPrecision.Kind,java.lang.Object>
- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()- Specified by:
_get
in interfaceTaggedUnion<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 kindgeohash_length
? -
geohashLength
public java.lang.Number geohashLength()Get thegeohash_length
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thegeohash_length
kind.
-
isDistance
public boolean isDistance()Is this variant instance of kinddistance
? -
distance
public java.lang.String distance()Get thedistance
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thedistance
kind.
-
serialize
- Specified by:
serialize
in interfaceJsonpSerializable
-