Class GeoLocation
- java.lang.Object
-
- org.opensearch.client.opensearch._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
-
-
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
All Methods Static Methods Instance Methods Concrete Methods 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.
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<GeoLocation> _DESERIALIZER
-
-
Method Detail
-
_kind
public final GeoLocation.Kind _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
public GeoHashLocation 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
public LatLonGeoLocation 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
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
-