Class Tuple2<T1,​T2>

  • Type Parameters:
    T1 - type of the first element
    T2 - type of the second element

    public class Tuple2<T1,​T2>
    extends java.lang.Object
    Simple tuple container that holds two elements.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private T1 first  
      private T2 second  
    • Constructor Summary

      Constructors 
      Constructor Description
      Tuple2​(T1 first, T2 second)
      Creates a new instance of Tuple2 with given elements.
    • Field Detail

      • first

        private final T1 first
      • second

        private final T2 second
    • Constructor Detail

      • Tuple2

        public Tuple2​(T1 first,
                      T2 second)
        Creates a new instance of Tuple2 with given elements.
        Parameters:
        first - the first element
        second - the second element
    • Method Detail

      • getFirst

        public T1 getFirst()
        Get the first element.
        Returns:
        the first element
      • getSecond

        public T2 getSecond()
        Get the second element.
        Returns:
        the second element
      • equals

        public boolean equals​(java.lang.Object obj)

        Note, that in case current class is overridden, equals should also be overridden.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj -
        Returns:
      • hashCode

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

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