Record Class MultiPolygon
java.lang.Object
java.lang.Record
io.micronaut.data.model.geo.MultiPolygon
- Record Components:
polygons- the polygons contained in this geometry
- All Implemented Interfaces:
Geometry
@TypeDef(type=STRING,
converter=GeometryJsonConverter.class)
public record MultiPolygon(List<Polygon> polygons)
extends Record
implements Geometry
Represents a geometry composed of one or more
Polygon values.
This type follows the GeoJSON MultiPolygon model and can be converted to nested polygon coordinate structures for serialization.
- Since:
- 5.0
-
Constructor Summary
ConstructorsConstructorDescriptionMultiPolygon(List<Polygon> polygons) Creates an instance of aMultiPolygonrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasCoords()Returns this multi-polygon as a list of polygon ring coordinate sequences.final booleanIndicates whether some other object is "equal to" this one.static MultiPolygonCreates aMultiPolygonfrom a list of polygon ring coordinate sequences.final inthashCode()Returns a hash code value for this object.polygons()Returns the value of thepolygonsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MultiPolygon
-
-
Method Details
-
asCoords
-
fromCoords
Creates aMultiPolygonfrom a list of polygon ring coordinate sequences.- Parameters:
coords- the polygon coordinates to convert- Returns:
- a multi-polygon created from the provided coordinates
- Throws:
IllegalArgumentException- ifcoordsisnullor empty
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
polygons
-