/** * Create a {@link Tuple1} with the given object. * * @param t1 The first value in the tuple. * @param <T1> The type of the first value. * @return The new {@link Tuple1}. */ public static <T1> Tuple1<T1> of(T1 t1) { return new Tuple1<T1>(1, t1); }
@Override public String toString() { return super.toString()+ (t2 != null ? ","+t2.toString() : ""); } }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Tuple2)) return false; if (!super.equals(o)) return false; Tuple2 tuple2 = (Tuple2) o; if (t2 != null ? !t2.equals(tuple2.t2) : tuple2.t2 != null) return false; return true; }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + (t2 != null ? t2.hashCode() : 0); return result; }