mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-01 07:11:30 +07:00
GitOrigin-RevId: d6f5fb8b21e233edd636f5ee315e5e7b167f9b91
41 lines
802 B
Java
41 lines
802 B
Java
import java.util.Objects;
|
|
|
|
// "Convert record to class" "true-preview"
|
|
final class Rec {
|
|
private final int x;
|
|
private final int y;
|
|
|
|
Rec(int x, int y {
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
|
|
public int x() {
|
|
return x;
|
|
}
|
|
|
|
public int y() {
|
|
return y;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) return true;
|
|
if (obj == null || obj.getClass() != this.getClass()) return false;
|
|
var that = (Rec) obj;
|
|
return this.x == that.x &&
|
|
this.y == that.y;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(x, y);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Rec[" +
|
|
"x=" + x + ", " +
|
|
"y=" + y + ']';
|
|
}
|
|
} |