Class Lseg

java.lang.Object
io.r2dbc.postgresql.codec.Lseg

public final class Lseg extends Object
Value object that maps to the lseg datatype in Postgres.

Uses double to represent the coordinates.

Since:
0.8.5
  • Method Details

    • of

      public static Lseg of(Point p1, Point p2)
      Create a new Lseg given parameters points p1 and p2.
      Parameters:
      p1 - first endpoint
      p2 - second endpoint
      Returns:
      the new Lseg object
      Throws:
      IllegalArgumentException - if p1 or p2 is null
    • of

      public static Lseg of(double p1x, double p1y, double p2x, double p2y)
      Create a new Lseg given parameters p1x, p1y, p2x and p2y.
      Parameters:
      p1x - the x axis coordinate of point p1
      p1y - the y axis coordinate of point p1
      p2x - the x axis coordinate of point p2
      p2y - the y axis coordinate of point p2
      Returns:
      the new Lseg object
      Since:
      0.9
    • getP1

      public Point getP1()
    • getP2

      public Point getP2()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object