Package com.azure.core.models
Class GeoCollection
java.lang.Object
com.azure.core.models.GeoObject
com.azure.core.models.GeoCollection
- All Implemented Interfaces:
com.azure.json.JsonSerializable<GeoObject>
Represents a heterogeneous collection of GeoObjects.
This class encapsulates a list of geometry objects and provides methods to access these objects.
The objects can be of any type that extends GeoObject.
This class is useful when you want to work with a collection of geometry objects in a read-only manner. For example, you can use it to represent a complex geographic feature that is composed of multiple simple geographic features.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGeoCollection(List<GeoObject> geometries) Constructs aGeoCollection.GeoCollection(List<GeoObject> geometries, GeoBoundingBox boundingBox, Map<String, Object> customProperties) Constructs aGeoCollection. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic GeoCollectionfromJson(com.azure.json.JsonReader jsonReader) Reads a JSON stream into aGeoCollection.Unmodifiable representation of thegeometriescontained in this collection.getType()Gets the GeoJSON type for this object.inthashCode()com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class com.azure.core.models.GeoObject
getBoundingBox, getCustomPropertiesMethods 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
-
GeoCollection
Constructs aGeoCollection.- Parameters:
geometries- The geometries in the collection.- Throws:
NullPointerException- Ifgeometriesisnull.
-
GeoCollection
public GeoCollection(List<GeoObject> geometries, GeoBoundingBox boundingBox, Map<String, Object> customProperties) Constructs aGeoCollection.- Parameters:
geometries- The geometries in the collection.boundingBox- Bounding box for theGeoCollection.customProperties- Additional properties of theGeoCollection.- Throws:
NullPointerException- Ifgeometriesisnull.
-
-
Method Details
-
getGeometries
Unmodifiable representation of thegeometriescontained in this collection.- Returns:
- An unmodifiable representation of the
geometriesin this collection.
-
getType
Description copied from class:GeoObjectGets the GeoJSON type for this object. -
hashCode
public int hashCode() -
equals
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<GeoObject>- Overrides:
toJsonin classGeoObject- Throws:
IOException
-
fromJson
Reads a JSON stream into aGeoCollection.- Parameters:
jsonReader- TheJsonReaderbeing read.- Returns:
- The
GeoCollectionthat the JSON stream represented, or null if it pointed to JSON null. - Throws:
IllegalStateException- If thetypenode exists and isn't equal toGeometryCollection.IOException- If aGeoCollectionfails to be read from thejsonReader.
-