Class Tuple<K,​V>

  • Type Parameters:
    K - The key
    V - The value

    public class Tuple<K,​V>
    extends java.lang.Object
    A tuple of objects.
    • Constructor Summary

      Constructors 
      Constructor Description
      Tuple​(K first, V second)
      Creates a new Tuple.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(@Nullable java.lang.Object obj)  
      K first()
      Gets the first object, otherwise known as "key".
      int hashCode()  
      static <K,​V>
      Tuple<K,​V>
      of​(K first, V second)
      Creates a new Tuple with the desired first and second objects.
      V second()
      Gets the second object, otherwise known as "value".
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Tuple

        public Tuple​(K first,
                     V second)
        Creates a new Tuple.
        Parameters:
        first - The first object
        second - The second object
    • Method Detail

      • of

        public static <K,​V> Tuple<K,​V> of​(K first,
                                                      V second)
        Creates a new Tuple with the desired first and second objects.
        Type Parameters:
        K - The type of first object
        V - The type of second object
        Parameters:
        first - The first object
        second - The second object
        Returns:
        The new Tuple
      • first

        public K first()
        Gets the first object, otherwise known as "key".
        Returns:
        The first object
      • second

        public V second()
        Gets the second object, otherwise known as "value".
        Returns:
        The value
      • 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​(@Nullable java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object