Class Circle

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

public final class Circle extends Object
Value object that maps to the circle datatype in Postgres.

Uses double to represent the coordinates.

Since:
0.8.5
  • Method Details

    • of

      public static Circle of(Point center, double radius)
      Create a new Circle given center and radius.
      Parameters:
      center - the center point
      radius - the radius
      Returns:
      the new Circle object
      Throws:
      IllegalArgumentException - if radius is null
    • of

      public static Circle of(double x, double y, double radius)
      Create a new Circle given center coordinates x/y and radius.
      Parameters:
      x - the x center coordinate
      y - the y center coordinate
      radius - the radius
      Returns:
      the new Circle object
    • getCenter

      public Point getCenter()
    • getRadius

      public double getRadius()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      Parameters:
      obj - Object to compare with
      Returns:
      true if the two circles are identical
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object