Class Tuple2<E0,​E1>

  • Type Parameters:
    E0 - the type of the field 0
    E1 - the type of the field 1
    All Implemented Interfaces:
    java.io.Serializable, java.util.Map.Entry<E0,​E1>

    public final class Tuple2<E0,​E1>
    extends java.lang.Object
    implements java.util.Map.Entry<E0,​E1>, java.io.Serializable
    An immutable 2-tuple (pair) of statically typed fields. Also implements Map.Entry.
    Since:
    Jet 3.0
    See Also:
    Serialized Form
    • Method Detail

      • tuple2

        public static <E0,​E1> Tuple2<E0,​E1> tuple2​(@Nullable
                                                               E0 f0,
                                                               @Nullable
                                                               E1 f1)
        Returns a new 2-tuple with the supplied values.
      • f0

        @Nullable
        public E0 f0()
        Returns the value of the field 0.
      • f1

        @Nullable
        public E1 f1()
        Returns the value of the field 1.
      • getKey

        @Nullable
        public E0 getKey()
        Specified by:
        getKey in interface java.util.Map.Entry<E0,​E1>
      • getValue

        @Nullable
        public E1 getValue()
        Specified by:
        getValue in interface java.util.Map.Entry<E0,​E1>
      • setValue

        public E1 setValue​(@Nullable
                           E1 value)
        Specified by:
        setValue in interface java.util.Map.Entry<E0,​E1>
      • requiredF0

        @Nonnull
        public E0 requiredF0()
        Returns the value of the f0, throwing if it's null.
      • requiredF1

        @Nonnull
        public E1 requiredF1()
        Returns the value of the f1, throwing if it's null..
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.util.Map.Entry<E0,​E1>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map.Entry<E0,​E1>
        Overrides:
        hashCode in class java.lang.Object
      • toString

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