All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lambdaworks.redis.ScoredValue Maven / Gradle / Ivy

// 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 String toString() {
        return String.format("(%f, %s)", score, value.toString());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy