/** * Type-safe way to get the fifth object of this {@link Tuple}. * * @return The fifth object, cast to the correct type. */ @SuppressWarnings("unchecked") public T5 getT5() { return (T5) get(4); }
/** * Create a {@link Tuple5} with the given objects. * * @param t1 The first value in the tuple. * @param t2 The second value in the tuple. * @param t3 The third value in the tuple. * @param t4 The fourth value in the tuple. * @param t5 The fifth value in the tuple. * @param <T1> The type of the first value. * @param <T2> The type of the second value. * @param <T3> The type of the third value. * @param <T4> The type of the fourth value. * @param <T5> The type of the fifth value. * @return The new {@link Tuple5}. */ public static <T1, T2, T3, T4, T5> Tuple5<T1, T2, T3, T4, T5> of(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) { return new Tuple5<T1, T2, T3, T4, T5>(t1, t2, t3, t4, t5); }