Record Class LineString
java.lang.Object
java.lang.Record
io.micronaut.data.model.geo.LineString
- Record Components:
points- the ordered points that define the line string
- All Implemented Interfaces:
Geometry
@TypeDef(type=STRING,
converter=GeometryJsonConverter.class)
public record LineString(List<Point> points)
extends Record
implements Geometry
Represents a line geometry defined by an ordered list of at least two
Point values.
This type follows the GeoJSON LineString model and can be converted to nested coordinate lists for serialization.
- Since:
- 5.0
-
Constructor Summary
ConstructorsConstructorDescriptionLineString(List<Point> points) Creates an instance of aLineStringrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasCoords()Returns this line string as an ordered list of point coordinate pairs.final booleanIndicates whether some other object is "equal to" this one.static LineStringfromCoords(List<List<Double>> coords) Creates aLineStringfrom an ordered list of point coordinate pairs.final inthashCode()Returns a hash code value for this object.points()Returns the value of thepointsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LineString
-
-
Method Details
-
asCoords
-
fromCoords
Creates aLineStringfrom an ordered list of point coordinate pairs.- Parameters:
coords- the point coordinates to convert- Returns:
- a line string created from the provided coordinates
- Throws:
IllegalArgumentException- ifcoordsisnull, empty, or contains fewer than two points
-
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). -
points
-