Class Tuple<K,​V>

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

    public class Tuple<K,​V>
    extends Object
    A tuple of objects.
    • 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
      • hashCode

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

        public boolean equals​(@Nullable Object obj)
        Overrides:
        equals in class Object