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>
An abstract geo object.
-
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) Writes the object to the passedJsonWriter.
-
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
Description copied from interface:com.azure.json.JsonSerializableWrites the object to the passedJsonWriter.The contract for writing JSON to
JsonWriteris that the object being written will handle opening and closing its own JSON object. So, for objects calling out to otherJsonSerializableobjects for serialization, they'll write the field name only then pass theJsonWriterto the otherJsonSerializableobject. This way objects writing JSON will be self-encapsulated for writing properly formatted JSON.- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<GeoObject>- Parameters:
jsonWriter- Where the object's JSON will be written.- Returns:
- The
JsonWriterwhere the JSON was written. - Throws:
IOException- If the object fails to be written to thejsonWriter.
-
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.
-