Package com.azure.core.models
Class GeoLinearRing
java.lang.Object
com.azure.core.models.GeoLinearRing
- All Implemented Interfaces:
com.azure.json.JsonSerializable<GeoLinearRing>
public final class GeoLinearRing
extends Object
implements com.azure.json.JsonSerializable<GeoLinearRing>
Represents a linear ring that is part of a
GeoPolygon.-
Constructor Summary
ConstructorsConstructorDescriptionGeoLinearRing(List<GeoPosition> coordinates) Constructs a new linear ring with the passed coordinates. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic GeoLinearRingfromJson(com.azure.json.JsonReader jsonReader) Reads a JSON stream into aGeoLinearRing.Unmodifiable representation of thegeometric positionsrepresenting this linear ring.inthashCode()com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Writes the object to the passedJsonWriter.
-
Constructor Details
-
GeoLinearRing
Constructs a new linear ring with the passed coordinates.- Parameters:
coordinates- The coordinates of the linear ring.- Throws:
NullPointerException- Ifcoordinatesis null.IllegalArgumentException- Ifcoordinateshas less than 4 elements or the first and last elements aren't equivalent.
-
-
Method Details
-
getCoordinates
Unmodifiable representation of thegeometric positionsrepresenting this linear ring.- Returns:
- An unmodifiable representation of the
geometric positionsrepresenting this linear ring.
-
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<GeoLinearRing>- 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 a JSON stream into aGeoLinearRing.- Parameters:
jsonReader- TheJsonReaderbeing read.- Returns:
- The
GeoLinearRingthat the JSON stream represented, or null if it pointed to JSON null. - Throws:
IOException- If aGeoLinearRingfails to be read from thejsonReader.
-