Class GeoLocation
java.lang.Object
co.elastic.clients.elasticsearch._types.GeoLocation
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<GeoLocation.Kind,java.lang.Object>
@JsonpDeserializable public class GeoLocation extends java.lang.Object implements TaggedUnion<GeoLocation.Kind,java.lang.Object>, JsonpSerializable
A latitude/longitude as a 2 dimensional point. It can be represented in
various ways:
- as a
{lat, long}object - as a geo hash value
- as a
[lon, lat]array - as a string in
"<lat>, <lon>"or WKT point formats
- See Also:
- API specification
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGeoLocation.Builderstatic classGeoLocation.Kind -
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<GeoLocation>_DESERIALIZER -
Method Summary
Modifier and Type Method Description java.lang.Object_get()GeoLocation.Kind_kind()Get the of the kind of variant held by this object.java.util.List<java.lang.Double>coords()Get thecoordsvariant value.GeoHashLocationgeohash()Get thegeohashvariant value.booleanisCoords()Is this variant instance of kindcoords?booleanisGeohash()Is this variant instance of kindgeohash?booleanisLatlon()Is this variant instance of kindlatlon?booleanisText()Is this variant instance of kindtext?LatLonGeoLocationlatlon()Get thelatlonvariant value.static GeoLocationof(java.util.function.Function<GeoLocation.Builder,ObjectBuilder<GeoLocation>> fn)voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)java.lang.Stringtext()Get thetextvariant value.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:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<GeoLocation.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()- Specified by:
_getin interfaceTaggedUnion<GeoLocation.Kind,java.lang.Object>
-
of
public static GeoLocation of(java.util.function.Function<GeoLocation.Builder,ObjectBuilder<GeoLocation>> fn) -
isCoords
public boolean isCoords()Is this variant instance of kindcoords? -
coords
public java.util.List<java.lang.Double> coords()Get thecoordsvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thecoordskind.
-
isGeohash
public boolean isGeohash()Is this variant instance of kindgeohash? -
geohash
Get thegeohashvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thegeohashkind.
-
isLatlon
public boolean isLatlon()Is this variant instance of kindlatlon? -
latlon
Get thelatlonvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thelatlonkind.
-
isText
public boolean isText()Is this variant instance of kindtext? -
text
public java.lang.String text()Get thetextvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetextkind.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-