mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-15 23:26:21 +01:00
Merge pull request #227 from Project-Cepi/update-option-equals
Equals & hashcode overrides for UpdateOption
This commit is contained in:
commit
64479b1409
@ -2,6 +2,8 @@ package net.minestom.server.utils.time;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class UpdateOption {
|
public class UpdateOption {
|
||||||
|
|
||||||
private final long value;
|
private final long value;
|
||||||
@ -20,4 +22,17 @@ public class UpdateOption {
|
|||||||
public TimeUnit getTimeUnit() {
|
public TimeUnit getTimeUnit() {
|
||||||
return timeUnit;
|
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