Class GeoHashPrecision
- java.lang.Object
-
- org.opensearch.client.opensearch._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".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGeoHashPrecision.Builderstatic classGeoHashPrecision.Kind
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<GeoHashPrecision>_DESERIALIZER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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.Stringdistance()Get thedistancevariant value.java.lang.NumbergeohashLength()Get thegeohash_lengthvariant value.booleanisDistance()Is this variant instance of kinddistance?booleanisGeohashLength()Is this variant instance of kindgeohash_length?static GeoHashPrecisionof(java.util.function.Function<GeoHashPrecision.Builder,ObjectBuilder<GeoHashPrecision>> fn)voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<GeoHashPrecision> _DESERIALIZER
-
-
Method Detail
-
_kind
public final GeoHashPrecision.Kind _kind()
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<GeoHashPrecision.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()
- Specified by:
_getin 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_lengthvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thegeohash_lengthkind.
-
isDistance
public boolean isDistance()
Is this variant instance of kinddistance?
-
distance
public java.lang.String distance()
Get thedistancevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thedistancekind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
-