mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-10 09:21:28 +01:00
Equals & hashcode overrides
This commit is contained in:
parent
0bb8144d33
commit
9d1d60cdcd
@ -2,6 +2,8 @@ package net.minestom.server.utils.time;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class UpdateOption {
|
||||
|
||||
private final long value;
|
||||
@ -20,4 +22,17 @@ public class UpdateOption {
|
||||
public TimeUnit getTimeUnit() {
|
||||
return timeUnit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(value, timeUnit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
UpdateOption updateOption = (UpdateOption) o;
|
||||
return Objects.equals(value, updateOption.value) && Objects.equals(timeUnit, updateOption.timeUnit);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user