Replace delombok-ed equals and hashCode methods (#3518)

* regenerate leftover delombok-ed equals and hashCode methods

* delegate to hashCode directly instead of single parameter calls
This commit is contained in:
Hannes Greule
2022-02-27 18:51:37 +01:00
committed by GitHub
parent 954c813cef
commit 75f31c5bf6
5 changed files with 71 additions and 90 deletions

View File

@ -83,34 +83,31 @@ public class BukkitWorld implements World<org.bukkit.World> {
return this.world.getName();
}
@Override
public boolean equals(final Object o) {
if (o == this) {
if (this == o) {
return true;
}
if (!(o instanceof final BukkitWorld other)) {
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!other.canEqual(this)) {
return false;
}
if (!Objects.equals(this.world, other.world)) {
return false;
}
return true;
final BukkitWorld that = (BukkitWorld) o;
return world.equals(that.world);
}
@Override
public int hashCode() {
return world.hashCode();
}
/**
* @deprecated This method is not meant to be invoked or overridden, with no replacement.
*/
@Deprecated(forRemoval = true, since = "TODO")
protected boolean canEqual(final Object other) {
return other instanceof BukkitWorld;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $world = this.world;
result = result * PRIME + ($world == null ? 43 : $world.hashCode());
return result;
}
public String toString() {
return "BukkitWorld(world=" + this.world + ")";
}