Class Tuple3<A,​B,​C>

  • Type Parameters:
    A - The object a type.
    B - The object b type.
    C - The object c type.

    public class Tuple3<A,​B,​C>
    extends Tuple2<A,​B>
    Three-object holder. The three objects are called by convention, a, b and c.
    Implements equals(Object) and hashCode(), based on the three objects.
    If two tuples tup1 and tup2 have the same objects, but in different order, tup1.equals(tup2) may be false and tup1.hashCode() == tup2.hashCode() may be false.
    Example:
    Tuple3.newInstance(1, 2, 3).equals(Tuple3.newInstance(3, 2, 1)) is false.
    Tuple3.newInstance(1, 2, 3).hashCode() == Tuple3.newInstance(3, 2, 1).hashCode() is false.
    This holder accepts null values.
    Since:
    10.2.0
    Version:
    $Revision$ $Date$
    • Method Detail

      • of

        public static <A,​B,​C> Tuple3<A,​B,​C> of​(A a,
                                                                       B b,
                                                                       C c)
        Creates a new instance.
        Parameters:
        a - the object a.
        b - the object b.
        c - the object c.
        Returns:
        the created instance.
        Since:
        11.0.0
      • newInstance

        @Deprecated
        public static <A,​B,​C> Tuple3<A,​B,​C> newInstance​(A a,
                                                                                B b,
                                                                                C c)
        Deprecated.
        since 11.0.0, replaced by of(Object, Object, Object).
        Creates a new instance.
        Parameters:
        a - the object a.
        b - the object b.
        c - the object c.
        Returns:
        the created instance.
        Since:
        10.2.0
      • c

        public C c()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Tuple2<A,​B>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Tuple2<A,​B>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Tuple2<A,​B>
      • isEmpty

        public boolean isEmpty()
        Description copied from class: Tuple2
        Returns whether this tupple is empty (composed with null values).
        Overrides:
        isEmpty in class Tuple2<A,​B>
        Returns:
        whether this tupple is empty (composed with null values).