Class Point

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

public final class Point extends Object
Value object that maps to the point datatype in Postgres.

Uses double to represent the coordinates.

Since:
0.8.4
  • Method Details

    • of

      public static Point of(double x, double y)
      Create a new Point given x and y coordinates.
      Parameters:
      x - the x axis coordinate
      y - the y axis coordinate
      Returns:
      the new Point object
    • getX

      public double getX()
    • getY

      public double getY()
    • translate

      public Point translate(int x, int y)
      Translate the point by the supplied amount by adding x and y offsets.
      Parameters:
      x - integer amount to add on the x axis
      y - integer amount to add on the y axis
      Returns:
      new Point with translated values
    • translate

      public Point translate(double x, double y)
      Translate the point by the supplied amount by adding x and y offsets.
      Parameters:
      x - double amount to add on the x axis
      y - double amount to add on the y axis
      Returns:
      new Point with translated values
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object