Class Pair<K,​V>

java.lang.Object
it.polimi.ingsw.utility.Pair<K,​V>
Type Parameters:
K - the type of the key
V - the type of the value

public class Pair<K,​V>
extends java.lang.Object
Represents a pair of two object: a key and a value. It's an immutable object.
  • Constructor Summary

    Constructors
    Constructor Description
    Pair​(Pair<K,​V> pair)  
    Pair​(K key, V value)  
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    K getKey()  
    V getValue()  
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Pair

      public Pair​(K key, V value)
    • Pair

      public Pair​(Pair<K,​V> pair)
  • Method Details

    • getKey

      public K getKey()
    • getValue

      public V getValue()
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object