refactoring

pull/5079/head
Nikita Koksharov 2 years ago
parent 75602344df
commit 62a94887a0

@ -15,6 +15,8 @@
*/ */
package org.redisson.client.protocol; package org.redisson.client.protocol;
import java.util.Objects;
/** /**
* *
* @author Nikita Koksharov * @author Nikita Koksharov
@ -41,35 +43,15 @@ public class ScoredEntry<V> {
} }
@Override @Override
@SuppressWarnings("AvoidInlineConditionals") public boolean equals(Object o) {
public int hashCode() { if (this == o) return true;
final int prime = 31; if (o == null || getClass() != o.getClass()) return false;
int result = 1; ScoredEntry<?> that = (ScoredEntry<?>) o;
result = prime * result + ((score == null) ? 0 : score.hashCode()); return Objects.equals(score, that.score) && Objects.equals(value, that.value);
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
} }
@Override @Override
public boolean equals(Object obj) { public int hashCode() {
if (this == obj) return Objects.hash(score, value);
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ScoredEntry other = (ScoredEntry) obj;
if (score == null) {
if (other.score != null)
return false;
} else if (!score.equals(other.score))
return false;
if (value == null) {
if (other.value != null)
return false;
} else if (!value.equals(other.value))
return false;
return true;
} }
} }

Loading…
Cancel
Save