/** * Create a {@link Tuple2} with the given objects. * * @param t1 The first value in the tuple. * @param t2 The second value in the tuple. * @param <T1> The type of the first value. * @param <T2> The type of the second value. * @return The new {@link Tuple2}. */ public static <T1, T2> Tuple2<T1, T2> of(T1 t1, T2 t2) { return new Tuple2<T1, T2>(2, t1, t2); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Tuple3)) return false; if (!super.equals(o)) return false; Tuple3 tuple3 = (Tuple3) o; if (t3 != null ? !t3.equals(tuple3.t3) : tuple3.t3 != null) return false; return true; }
@Override public String toString() { return super.toString()+ (t3 != null ? ","+t3.toString() : ""); } }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (t3 != null ? t3.hashCode() : 0); return result; }
@Override public V apply(LEFT left, RIGHT right) { return function.apply(Tuple2.of(left, right)); } };