mirror of
https://github.com/Ellpeck/PrettyPipes.git
synced 2024-12-22 23:39:22 +01:00
network lock equality, for the future
This commit is contained in:
parent
ccc981fee3
commit
58558781eb
1 changed files with 16 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
package de.ellpeck.prettypipes.network;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class NetworkLock {
|
||||
|
||||
public final NetworkLocation location;
|
||||
|
@ -11,4 +13,18 @@ public class NetworkLock {
|
|||
this.slot = slot;
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof NetworkLock) {
|
||||
NetworkLock that = (NetworkLock) o;
|
||||
return this.slot == that.slot && this.amount == that.amount && this.location.equals(that.location);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(this.location, this.slot, this.amount);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue