Package com.azure.core.models
Class GeoObject
java.lang.Object
com.azure.core.models.GeoObject
- All Implemented Interfaces:
com.azure.json.JsonSerializable<GeoObject>
- Direct Known Subclasses:
GeoCollection,GeoLineString,GeoLineStringCollection,GeoPoint,GeoPointCollection,GeoPolygon,GeoPolygonCollection
public abstract class GeoObject
extends Object
implements com.azure.json.JsonSerializable<GeoObject>
Represents an abstract geometric object in GeoJSON format.
This class encapsulates the common properties of a geometric object, including the bounding box and additional custom properties. It provides methods to access these properties.
This class also provides a toJson(JsonWriter) method to serialize the geometric object to JSON,
and a fromJson(JsonReader) method to deserialize a geometric object from JSON.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic GeoObjectfromJson(com.azure.json.JsonReader jsonReader) Reads an instance ofGeoObjectfrom the JsonReader.final GeoBoundingBoxBounding box for thisGeoObject.Additional properties about thisGeoObject.abstract GeoObjectTypegetType()Gets the GeoJSON type for this object.inthashCode()com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
Method Details
-
getType
Gets the GeoJSON type for this object.- Returns:
- The GeoJSON type for this object.
-
getBoundingBox
Bounding box for thisGeoObject.- Returns:
- The bounding box for this
GeoObject.
-
getCustomProperties
Additional properties about thisGeoObject.- Returns:
- An unmodifiable representation of the additional properties associated with this
GeoObject.
-
hashCode
public int hashCode() -
equals
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<GeoObject>- Throws:
IOException
-
fromJson
Reads an instance ofGeoObjectfrom the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of
GeoObjectif the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null. - Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties or the polymorphic discriminator.IOException- If an error occurs while reading theGeoObject.
-