Package com.azure.core.models
Class GeoPolygonCollection
java.lang.Object
com.azure.core.models.GeoObject
com.azure.core.models.GeoPolygonCollection
- All Implemented Interfaces:
com.azure.json.JsonSerializable<GeoObject>
Represents a collection of
GeoPolygons.-
Constructor Summary
ConstructorsConstructorDescriptionGeoPolygonCollection(List<GeoPolygon> polygons) Constructs aGeoPolygonCollection.GeoPolygonCollection(List<GeoPolygon> polygons, GeoBoundingBox boundingBox, Map<String, Object> customProperties) Constructs aGeoPolygonCollection. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic GeoPolygonCollectionfromJson(com.azure.json.JsonReader jsonReader) Reads a JSON stream into aGeoPolygonCollection.Unmodifiable representation of thegeometric polygonsrepresenting this multi-polygon.getType()Gets the GeoJSON type for this object.inthashCode()com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Writes the object to the passedJsonWriter.Methods inherited from class com.azure.core.models.GeoObject
getBoundingBox, getCustomProperties
-
Constructor Details
-
GeoPolygonCollection
Constructs aGeoPolygonCollection.- Parameters:
polygons- The polygons that define the multi-polygon.- Throws:
NullPointerException- Ifpolygonsisnull.
-
GeoPolygonCollection
public GeoPolygonCollection(List<GeoPolygon> polygons, GeoBoundingBox boundingBox, Map<String, Object> customProperties) Constructs aGeoPolygonCollection.- Parameters:
polygons- The polygons that define the multi-polygon.boundingBox- Bounding box for the multi-polygon.customProperties- Additional properties of the multi-polygon.- Throws:
NullPointerException- Ifpolygonsisnull.
-
-
Method Details
-
getPolygons
Unmodifiable representation of thegeometric polygonsrepresenting this multi-polygon.- Returns:
- An unmodifiable representation of the
geometric polygonsrepresenting this multi-polygon.
-
getType
Description copied from class:GeoObjectGets the GeoJSON type for this object. -
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>- Overrides:
toJsonin classGeoObject- 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
public static GeoPolygonCollection fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads a JSON stream into aGeoPolygonCollection.- Parameters:
jsonReader- TheJsonReaderbeing read.- Returns:
- The
GeoPolygonCollectionthat the JSON stream represented, or null if it pointed to JSON null. - Throws:
IllegalStateException- If thetypenode exists and isn't equal toMultiPolygon.IOException- If aGeoPolygonCollectionfails to be read from thejsonReader.
-