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 class
GeoLocation.Builder
static class
GeoLocation.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 thecoords
variant value.GeoHashLocation
geohash()
Get thegeohash
variant value.boolean
isCoords()
Is this variant instance of kindcoords
?boolean
isGeohash()
Is this variant instance of kindgeohash
?boolean
isLatlon()
Is this variant instance of kindlatlon
?boolean
isText()
Is this variant instance of kindtext
?LatLonGeoLocation
latlon()
Get thelatlon
variant value.static GeoLocation
of(java.util.function.Function<GeoLocation.Builder,ObjectBuilder<GeoLocation>> fn)
void
serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
java.lang.String
text()
Get thetext
variant 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:TaggedUnion
Get the of the kind of variant held by this object.- Specified by:
_kind
in interfaceTaggedUnion<GeoLocation.Kind,java.lang.Object>
- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()- Specified by:
_get
in 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 thecoords
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thecoords
kind.
-
isGeohash
public boolean isGeohash()Is this variant instance of kindgeohash
? -
geohash
Get thegeohash
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thegeohash
kind.
-
isLatlon
public boolean isLatlon()Is this variant instance of kindlatlon
? -
latlon
Get thelatlon
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thelatlon
kind.
-
isText
public boolean isText()Is this variant instance of kindtext
? -
text
public java.lang.String text()Get thetext
variant value.- Throws:
java.lang.IllegalStateException
- if the current variant is not of thetext
kind.
-
serialize
- Specified by:
serialize
in interfaceJsonpSerializable
-