mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-28 12:22:31 +00:00
4d24542dac
Also fixed the total lack of canEqual in the usage examples.
26 lines
484 B
Java
26 lines
484 B
Java
@lombok.EqualsAndHashCode
|
|
class EqualsAndHashCodeWithExistingMethods {
|
|
int x;
|
|
|
|
public int hashCode() {
|
|
return 42;
|
|
}
|
|
}
|
|
|
|
@lombok.EqualsAndHashCode
|
|
final class EqualsAndHashCodeWithExistingMethods2 {
|
|
int x;
|
|
|
|
public boolean equals(Object other) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
@lombok.EqualsAndHashCode(callSuper=true)
|
|
final class EqualsAndHashCodeWithExistingMethods3 extends EqualsAndHashCodeWithExistingMethods {
|
|
int x;
|
|
|
|
private boolean canEqual(Object other) {
|
|
return true;
|
|
}
|
|
} |