package io.vertx.pgclient.data;
import io.vertx.codegen.annotations.DataObject;
import io.vertx.core.json.JsonObject;
@DataObject(generateConverter = true)
public class Point {
public double x, y;
public Point() {
this(0, 0);
}
public Point(double x, double y) {
this.x = x;
this.y = y;
}
public Point(JsonObject json) {
PointConverter.fromJson(json, this);
}
public double getX() {
return x;
}
public Point setX(double x) {
this.x = x;
return this;
}
public double getY() {
return y;
}
public Point setY(double y) {
this.y = y;
return this;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof Point) {
Point that = (Point) obj;
return x == that.x && y == that.y;
}
return false;
}
@Override
public String toString() {
return "Point(" + x + "," + y + ")";
}
public JsonObject toJson() {
JsonObject json = new JsonObject();
PointConverter.toJson(this, json);
return json;
}
}