Class Pair<K,​V>

  • Type Parameters:
    K - key parameter type.
    V - value parameter type.

    public class Pair<K,​V>
    extends java.lang.Object
    Class which represents a pair of key and value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private K key  
      private V value  
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair​(K key, V value)
      Creates key-value pair.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      K getKey()
      Gets key parameter.
      V getValue()
      Gets value parameter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • key

        private final K key
      • value

        private final V value
    • Constructor Detail

      • Pair

        public Pair​(K key,
                    V value)
        Creates key-value pair.
        Parameters:
        key - key parameter
        value - value parameter
    • Method Detail

      • getKey

        public K getKey()
        Gets key parameter.
        Returns:
        key parameter.
      • getValue

        public V getValue()
        Gets value parameter.
        Returns:
        value parameter.