Class GeoLocation
java.lang.Object
co.elastic.clients.elasticsearch._types.GeoLocation
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<GeoLocation.Kind,Object>
@JsonpDeserializable
public class GeoLocation
extends Object
implements TaggedUnion<GeoLocation.Kind,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:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal Object_get()final GeoLocation.Kind_kind()Get the of the kind of variant held by this object.coords()Get thecoordsvariant value.geohash()Get thegeohashvariant value.booleanisCoords()Is this variant instance of kindcoords?booleanIs this variant instance of kindgeohash?booleanisLatlon()Is this variant instance of kindlatlon?booleanisText()Is this variant instance of kindtext?latlon()Get thelatlonvariant value.static GeoLocationvoidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) text()Get thetextvariant value.toString()
-
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,Object> - Returns:
- the variant kind
-
_get
- Specified by:
_getin interfaceTaggedUnion<GeoLocation.Kind,Object>
-
of
-
isCoords
public boolean isCoords()Is this variant instance of kindcoords? -
coords
Get thecoordsvariant value.- Throws:
IllegalStateException- if the current variant is not of thecoordskind.
-
isGeohash
public boolean isGeohash()Is this variant instance of kindgeohash? -
geohash
Get thegeohashvariant value.- Throws:
IllegalStateException- if the current variant is not of thegeohashkind.
-
isLatlon
public boolean isLatlon()Is this variant instance of kindlatlon? -
latlon
Get thelatlonvariant value.- Throws:
IllegalStateException- if the current variant is not of thelatlonkind.
-
isText
public boolean isText()Is this variant instance of kindtext? -
text
Get thetextvariant value.- Throws:
IllegalStateException- if the current variant is not of thetextkind.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-
toString
-