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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T1 getFirst()
      Get the first element.
      T2 getSecond()
      Get the second element.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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
      • toString

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