java.lang.Object
nl.jqno.equalsverifier.internal.prefabvalues.Tuple<T>

public final class Tuple<T> extends Object
Container for three values of the same type: a "red" one, a "blue" one, and a shallow copy of the "red" one.
  • Constructor Details

    • Tuple

      public Tuple(T red, T blue, T redCopy)
      Constructor.
      Parameters:
      red - The red value.
      blue - The blue value.
      redCopy - A shallow copy of the red value.
  • Method Details

    • of

      public static <U> Tuple<U> of(Object red, Object blue, Object redCopy)
      Factory method that turns three untyped values into a typed tuple.
      Type Parameters:
      U - The assumed type of the values.
      Parameters:
      red - The red value.
      blue - The blue value.
      redCopy - A shallow copy of the red value.
      Returns:
      A typed tuple with the three given values.
    • getRed

      public T getRed()
      Returns:
      The red value.
    • getBlue

      public T getBlue()
      Returns:
      The blue value.
    • getRedCopy

      public T getRedCopy()
      Returns:
      The shallow copy of the red value.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object