Class Box

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

public final class Box extends Object
Value object that maps to the box datatype in Postgres.

Uses double to represent the coordinates.

Since:
0.8.5
  • Method Details

    • of

      public static Box of(Point a, Point b)
      Create a new Box given parameters points a and b.

      Any two opposite corners can be supplied on input, but the values will be reordered as needed to store the upper right and lower left corners, in that order.

      Parameters:
      a - first corner
      b - second corner
      Returns:
      the new Box object
      Throws:
      IllegalArgumentException - if a or b is null
    • of

      public static Box of(double ax, double ay, double bx, double by)
      Create a new Box given parameters ax, ay, bx and by.

      Any two opposite corners can be supplied on input, but the values will be reordered as needed to store the upper right and lower left corners, in that order.

      Parameters:
      ax - the x axis coordinate of point a
      ay - the y axis coordinate of point a
      bx - the x axis coordinate of point b
      by - the y axis coordinate of point b
      Returns:
      the new Box object
      Since:
      0.9
    • getA

      public Point getA()
    • getB

      public Point getB()
    • 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