com.lambdaworks.redis.KeyValue 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 key-value pair.
*
* @author Will Glozer
*/
public class KeyValue {
public final K key;
public final V value;
public KeyValue(K key, V value) {
this.key = key;
this.value = value;
}
@Override
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
KeyValue, ?> that = (KeyValue, ?>) o;
return key.equals(that.key) && value.equals(that.value);
}
@Override
public int hashCode() {
return 31 * key.hashCode() + value.hashCode();
}
@Override
public String toString() {
return String.format("(%s, %s)", key, value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy