com.lambdaworks.redis.ScoredValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redisson Show documentation
Show all versions of redisson Show documentation
Redis Java client with features of In-Memory Data Grid
// Copyright (C) 2011 - Will Glozer. All rights reserved.
package com.lambdaworks.redis;
/**
* A value and its associated score from a ZSET.
*
* @author Will Glozer
*/
public class ScoredValue {
public final double score;
public final V value;
public ScoredValue(double score, V value) {
this.score = score;
this.value = value;
}
@Override
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
ScoredValue> that = (ScoredValue>) o;
return Double.compare(that.score, score) == 0 && value.equals(that.value);
}
@Override
public int hashCode() {
long temp = score != +0.0d ? Double.doubleToLongBits(score) : 0L;
int result = (int) (temp ^ (temp >>> 32));
return 31 * result + (value != null ? value.hashCode() : 0);
}
@Override
public String toString() {
return String.format("(%f, %s)", score, value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy