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.
This class encapsulates a list of GeoPosition instances that form a closed loop, which is a component
of a GeoPolygon. The first and last positions of the loop are the same, forming a closed ring.
This class is useful when you want to work with a linear ring in a geographic context. For example, you can
use it to define the boundary of a geographic area in a GeoPolygon.
Note: A linear ring requires at least 4 coordinates, and the first and last coordinates must be the same.
- See Also:
-
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) 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
-
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
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<GeoLinearRing>- Throws:
IOException
-
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.
-