-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTuple9.java
More file actions
41 lines (32 loc) · 1.33 KB
/
Tuple9.java
File metadata and controls
41 lines (32 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package org.lambdaql;
import org.lambdaql.utils.Consumer9;
import org.lambdaql.utils.Function9;
import java.util.List;
public record Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9) implements Tuple {
public static <T1, T2, T3, T4, T5, T6, T7, T8, T9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> of(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9) {
return new Tuple9<>(t1, t2, t3, t4, t5, t6, t7, t8, t9);
}
public T1 component1() { return t1; }
public T2 component2() { return t2; }
public T3 component3() { return t3; }
public T4 component4() { return t4; }
public T5 component5() { return t5; }
public T6 component6() { return t6; }
public T7 component7() { return t7; }
public T8 component8() { return t8; }
public T9 component9() { return t9; }
@Override
public List<Object> toList() {
return List.of(t1, t2, t3, t4, t5, t6, t7, t8, t9);
}
@Override
public int arity() {
return 9;
}
public <R> R map(Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> mapper) {
return mapper.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9);
}
public void forEach(Consumer9<T1, T2, T3, T4, T5, T6, T7, T8, T9> action) {
action.accept(t1, t2, t3, t4, t5, t6, t7, t8, t9);
}
}