Compares this pair to another based on the two elements. @param obj the object to compare to, null returns false. @return true if the elements of the pair are equal.
(final Object obj)
| 165 | * @return true if the elements of the pair are equal. |
| 166 | */ |
| 167 | @Override |
| 168 | public boolean equals(final Object obj) { |
| 169 | if (obj == this) { |
| 170 | return true; |
| 171 | } |
| 172 | if (obj instanceof Map.Entry<?, ?>) { |
| 173 | final Map.Entry<?, ?> other = (Map.Entry<?, ?>) obj; |
| 174 | return Objects.equals(getKey(), other.getKey()) |
| 175 | && Objects.equals(getValue(), other.getValue()); |
| 176 | } |
| 177 | return false; |
| 178 | } |
| 179 | |
| 180 | /** |
| 181 | * Gets the key from this pair. |
no test coverage detected