mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-20 03:20:56 +07:00
31 lines
834 B
Java
31 lines
834 B
Java
class Test {
|
|
int i;
|
|
Test a;
|
|
Test b;
|
|
double c;
|
|
|
|
public boolean equals(Object o) {
|
|
if (this == o) return true;
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
|
|
final Test test = (Test) o;
|
|
|
|
if (Double.compare(test.c, c) != 0) return false;
|
|
if (i != test.i) return false;
|
|
if (!a.equals(test.a)) return false;
|
|
if (b != null ? !b.equals(test.b) : test.b != null) return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
public int hashCode() {
|
|
int result;
|
|
long temp;
|
|
result = i;
|
|
result = 31 * result + a.hashCode();
|
|
result = 31 * result + (b != null ? b.hashCode() : 0);
|
|
temp = c != +0.0d ? Double.doubleToLongBits(c) : 0L;
|
|
result = 31 * result + (int) (temp ^ (temp >>> 32));
|
|
return result;
|
|
}
|
|
} |