@Test public void testAccessingOutOfIndex() { assertThrows(IndexOutOfBoundsException.class, () -> someTuple.nth(10)); }
@Override public Object nth(int index) { assertIndexInBounds(index); if (index == 4) { return item5; } else { return super.nth(index); } }
Tuple5 extends Tuple4<T1, T2, T3, T4> implements Tuple { @Override public Object nth(int index) { assertIndexInBounds(index); if (index == 4) { return item5; } else { return super.nth(index); } } }
Tuple5 extends Tuple4<T1, T2, T3, T4> implements Tuple { @Override public Object nth(int index) { assertIndexInBounds(index); if (index == 4) { return item5; } else { return super.nth(index); } } Tuple5(T1 a, T2 b, T3 c, T4 d, T5 e); }
Tuple5 extends Tuple4<T1, T2, T3, T4> implements Tuple { @Override public Object nth(int index) { assertIndexInBounds(index); if (index == 4) { return item5; } else { return super.nth(index); } } Tuple5(T1 a, T2 b, T3 c, T4 d, T5 e); static Tuple5<T1, T2, T3, T4, T5> of(T1 a, T2 b, T3 c, T4 d, T5 e); T5 getItem5(); @Override Tuple5<T, T2, T3, T4, T5> mapItem1(Function<T1, T> mapper); @Override Tuple5<T1, T, T3, T4, T5> mapItem2(Function<T2, T> mapper); @Override Tuple5<T1, T2, T, T4, T5> mapItem3(Function<T3, T> mapper); @Override Tuple5<T1, T2, T3, T, T5> mapItem4(Function<T4, T> mapper); Tuple5<T1, T2, T3, T4, T> mapItem5(Function<T5, T> mapper); @Override Object nth(int index); @Override List<Object> asList(); @Override int size(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
Tuple5 extends Tuple4<T1, T2, T3, T4> implements Tuple { @Override public Object nth(int index) { assertIndexInBounds(index); if (index == 4) { return item5; } else { return super.nth(index); } } Tuple5(T1 a, T2 b, T3 c, T4 d, T5 e); static Tuple5<T1, T2, T3, T4, T5> of(T1 a, T2 b, T3 c, T4 d, T5 e); T5 getItem5(); @Override Tuple5<T, T2, T3, T4, T5> mapItem1(Function<T1, T> mapper); @Override Tuple5<T1, T, T3, T4, T5> mapItem2(Function<T2, T> mapper); @Override Tuple5<T1, T2, T, T4, T5> mapItem3(Function<T3, T> mapper); @Override Tuple5<T1, T2, T3, T, T5> mapItem4(Function<T4, T> mapper); Tuple5<T1, T2, T3, T4, T> mapItem5(Function<T5, T> mapper); @Override Object nth(int index); @Override List<Object> asList(); @Override int size(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }