mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 10:14:42 +02:00
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:
@ -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 + ")";
|
||||
}
|
||||
|
Reference in New Issue
Block a user