Package com.linkare.commons.utils
Class Pair<K,V>
- java.lang.Object
-
- com.linkare.commons.utils.Pair<K,V>
-
- Type Parameters:
K- The key type element in this pair.V- The value type element in this pair.
- All Implemented Interfaces:
Serializable
public final class Pair<K,V> extends Object implements Serializable
Generic class to represent a relation between two different objects (the key and the value).- Author:
- Paulo Zenida - Linkare TI
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static intHASH_CODE_INITprivate static intHASH_CODE_MULTIPLIERprivate Kkeyprivate static longserialVersionUIDprivate Vvalue
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
HASH_CODE_INIT
private static final int HASH_CODE_INIT
- See Also:
- Constant Field Values
-
HASH_CODE_MULTIPLIER
private static final int HASH_CODE_MULTIPLIER
- See Also:
- Constant Field Values
-
key
private final K key
-
value
private final V value
-
-
Method Detail
-
getKey
public K getKey()
- Returns:
- the key.
-
getValue
public V getValue()
- Returns:
- the value.
-
equalsTo
private boolean equalsTo(Pair<K,V> other)
- Parameters:
other- the other to be compared with the implicit pair.- Returns:
- true if
otheris equal tothis. Returns false otherwise. - See Also:
EqualityUtils.equals(Object, Object)
-
-