mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 15:50:53 +07:00
29 lines
716 B
Java
29 lines
716 B
Java
import java.util.Objects;
|
|
|
|
class Test {
|
|
int i;
|
|
Test a;
|
|
Test b;
|
|
double c;
|
|
|
|
public boolean equals(Object o) {
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
|
|
final Test test = (Test) o;
|
|
return i == test.i &&
|
|
Double.compare(c, test.c) == 0 &&
|
|
a.equals(test.a) &&
|
|
Objects.equals(b, test.b);
|
|
}
|
|
|
|
public int hashCode() {
|
|
int result;
|
|
long temp;
|
|
result = i;
|
|
result = 31 * result + a.hashCode();
|
|
result = 31 * result + Objects.hashCode(b);
|
|
temp = Double.doubleToLongBits(c);
|
|
result = 31 * result + (int) (temp ^ (temp >>> 32));
|
|
return result;
|
|
}
|
|
} |