Package com.azure.core.models
Class GeoLineString
java.lang.Object
com.azure.core.models.GeoObject
com.azure.core.models.GeoLineString
- All Implemented Interfaces:
com.azure.json.JsonSerializable<GeoObject>
Represents a geometric line.
-
Constructor Summary
ConstructorsConstructorDescriptionGeoLineString(List<GeoPosition> positions) Constructs a geometric line.GeoLineString(List<GeoPosition> positions, GeoBoundingBox boundingBox, Map<String, Object> customProperties) Constructs a geometric line. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic GeoLineStringfromJson(com.azure.json.JsonReader jsonReader) Reads a JSON stream into aGeoLineString.Unmodifiable representation of thegeometric positionsrepresenting this line.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
-
GeoLineString
Constructs a geometric line.- Parameters:
positions- Geometric positions that define the line.- Throws:
NullPointerException- Ifpositionsisnull.
-
GeoLineString
public GeoLineString(List<GeoPosition> positions, GeoBoundingBox boundingBox, Map<String, Object> customProperties) Constructs a geometric line.- Parameters:
positions- Geometric positions that define the line.boundingBox- Bounding box for the line.customProperties- Additional properties of the geometric line.- Throws:
NullPointerException- Ifpositionsisnull.
-
-
Method Details
-
getCoordinates
Unmodifiable representation of thegeometric positionsrepresenting this line.- Returns:
- An unmodifiable representation of the
geometric positionsrepresenting this line.
-
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
Reads a JSON stream into aGeoLineString.- Parameters:
jsonReader- TheJsonReaderbeing read.- Returns:
- The
GeoLineStringthat the JSON stream represented, or null if it pointed to JSON null. - Throws:
IllegalStateException- If thetypenode exists and isn't equal toLineString.IOException- If aGeoLineStringfails to be read from thejsonReader.
-