/** * Type-safe way to get the first object of this {@link Tuple}. * * @return The first object, cast to the correct type. */ @SuppressWarnings("unchecked") public T1 getT1() { return (T1) get(0); }
/** * 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>(t1); }