diff options
-rw-r--r-- | src/main/java/org/traccar/model/Pair.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/main/java/org/traccar/model/Pair.java b/src/main/java/org/traccar/model/Pair.java index fa856db96..b679de57b 100644 --- a/src/main/java/org/traccar/model/Pair.java +++ b/src/main/java/org/traccar/model/Pair.java @@ -23,22 +23,21 @@ public class Pair<K, V> { @SuppressWarnings("rawtypes") @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } Pair pair = (Pair) o; - if (!Objects.equals(first, pair.first)) return false; - if (!Objects.equals(second, pair.second)) return false; - - return true; + return Objects.equals(first, pair.first) && Objects.equals(second, pair.second); } @Override public int hashCode() { - int result = first != null ? first.hashCode() : 0; - result = 31 * result + (second != null ? second.hashCode() : 0); - return result; + return Objects.hash(first, second); } } |