
org.unidal.tuple.Pair Maven / Gradle / Ivy
The newest version!
package org.unidal.tuple;
/**
* Tuple to hold two elements: key and value.
*
* @param
* key
* @param
* value
*/
public class Pair implements Tuple {
private volatile K m_key;
private volatile V m_value;
public Pair() {
}
public Pair(K key, V value) {
m_key = key;
m_value = value;
}
public static Pair from(K key, V value) {
return new Pair(key, value);
}
@Override
@SuppressWarnings("unchecked")
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof Pair) {
Pair
© 2015 - 2025 Weber Informatics LLC | Privacy Policy