Class 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
    • Constructor Detail

      • Pair

        public Pair​(K key,
                    V value)
        Parameters:
        key - the key to set.
        value - the value to set.
    • Method Detail

      • getKey

        public K getKey()
        Returns:
        the key.
      • getValue

        public V getValue()
        Returns:
        the value.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equalsTo

        private boolean equalsTo​(Pair<K,​V> other)
        Parameters:
        other - the other to be compared with the implicit pair.
        Returns:
        true if other is equal to this. Returns false otherwise.
        See Also:
        EqualityUtils.equals(Object, Object)