mirror of
https://github.com/tiennm99/lombok.git
synced 2026-09-08 02:20:00 +00:00
[i660] canEqual is now protected instead of public.
Also fixed the total lack of canEqual in the usage examples.
This commit is contained in:
@@ -42,6 +42,10 @@ public class DataExample {
|
||||
return "DataExample(" + this.getName() + ", " + this.getAge() + ", " + this.getScore() + ", " + Arrays.deepToString(this.getTags()) + ")";
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof DataExample;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object o) {
|
||||
if (o == this) return true;
|
||||
if (!(o instanceof DataExample)) return false;
|
||||
@@ -90,6 +94,10 @@ public class DataExample {
|
||||
return "Exercise(name=" + this.getName() + ", value=" + this.getValue() + ")";
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof Exercise;
|
||||
}
|
||||
|
||||
@Override public boolean equals(Object o) {
|
||||
if (o == this) return true;
|
||||
if (!(o instanceof Exercise)) return false;
|
||||
|
||||
Reference in New Issue
Block a user