DATAREDIS-937 - Add equals/hashCode methods to RedisZSetCommands.Weights.

Original Pull Request: #386
This commit is contained in:
Mark Paluch
2019-02-26 10:26:19 +01:00
committed by Christoph Strobl
parent 02c260aae1
commit 22698a2976

View File

@@ -18,6 +18,7 @@ package org.springframework.data.redis.connection;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.function.DoubleUnaryOperator;
import java.util.function.Function;
@@ -164,6 +165,21 @@ public interface RedisZSetCommands {
public List<Double> toList() {
return Collections.unmodifiableList(weights);
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof Weights))
return false;
Weights weights1 = (Weights) o;
return Objects.equals(weights, weights1.weights);
}
@Override
public int hashCode() {
return Objects.hash(weights);
}
}
/**