|
1 | 1 | package com.github.lokic.javaplus.functional.entry;
|
2 | 2 |
|
3 | 3 | import com.github.lokic.javaplus.functional.consumer.Consumer2;
|
4 |
| -import com.github.lokic.javaplus.functional.function.Function2; |
5 |
| -import com.github.lokic.javaplus.functional.function.Function3; |
6 |
| -import com.github.lokic.javaplus.functional.function.Function4; |
| 4 | +import com.github.lokic.javaplus.functional.function.*; |
7 | 5 | import com.github.lokic.javaplus.functional.predicate.Predicate2;
|
8 |
| -import com.github.lokic.javaplus.tuple.Tuple2; |
9 |
| -import com.github.lokic.javaplus.tuple.Tuple3; |
| 6 | +import com.github.lokic.javaplus.tuple.*; |
10 | 7 |
|
11 | 8 | public interface EntryFunctional {
|
12 | 9 |
|
13 |
| - static <K, V, R> EntryFunction<K, V, R> function(Function2<K, V, R> function2) { |
14 |
| - return function2::apply; |
| 10 | + static <K, V, R> EntryFunction<K, V, R> function(Function2<K, V, R> function) { |
| 11 | + return function::apply; |
15 | 12 | }
|
16 | 13 |
|
17 |
| - static <T1, T2, V, R> EntryFunction<Tuple2<T1, T2>, V, R> function(Function3<T1, T2, V, R> function3) { |
18 |
| - return (t, v) -> function3.apply(t.getT1(), t.getT2(), v); |
| 14 | + static <T1, T2, V, R> EntryFunction<Tuple2<T1, T2>, V, R> function(Function3<T1, T2, V, R> function) { |
| 15 | + return (t, v) -> function.apply(t.getT1(), t.getT2(), v); |
19 | 16 | }
|
20 | 17 |
|
21 |
| - static <T1, T2, T3, V, R> EntryFunction<Tuple3<T1, T2, T3>, V, R> function(Function4<T1, T2, T3, V, R> function4) { |
22 |
| - return (t, v) -> function4.apply(t.getT1(), t.getT2(), t.getT3(), v); |
| 18 | + static <T1, T2, T3, V, R> EntryFunction<Tuple3<T1, T2, T3>, V, R> function(Function4<T1, T2, T3, V, R> function) { |
| 19 | + return (t, v) -> function.apply(t.getT1(), t.getT2(), t.getT3(), v); |
23 | 20 | }
|
24 | 21 |
|
| 22 | + static <T1, T2, T3, T4, V, R> EntryFunction<Tuple4<T1, T2, T3, T4>, V, R> function(Function5<T1, T2, T3, T4, V, R> function) { |
| 23 | + return (t, v) -> function.apply(t.getT1(), t.getT2(), t.getT3(), t.getT4(), v); |
| 24 | + } |
| 25 | + |
| 26 | + static <T1, T2, T3, T4, T5, V, R> EntryFunction<Tuple5<T1, T2, T3, T4, T5>, V, R> function(Function6<T1, T2, T3, T4, T5, V, R> function) { |
| 27 | + return (t, v) -> function.apply(t.getT1(), t.getT2(), t.getT3(), t.getT4(), t.getT5(), v); |
| 28 | + } |
| 29 | + |
| 30 | + static <T1, T2, T3, T4, T5, T6, V, R> EntryFunction<Tuple6<T1, T2, T3, T4, T5, T6>, V, R> function(Function7<T1, T2, T3, T4, T5, T6, V, R> function) { |
| 31 | + return (t, v) -> function.apply(t.getT1(), t.getT2(), t.getT3(), t.getT4(), t.getT5(), t.getT6(), v); |
| 32 | + } |
| 33 | + |
| 34 | + static <T1, T2, T3, T4, T5, T6, T7, V, R> EntryFunction<Tuple7<T1, T2, T3, T4, T5, T6, T7>, V, R> function(Function8<T1, T2, T3, T4, T5, T6, T7, V, R> function) { |
| 35 | + return (t, v) -> function.apply(t.getT1(), t.getT2(), t.getT3(), t.getT4(), t.getT5(), t.getT6(), t.getT7(), v); |
| 36 | + } |
| 37 | + |
| 38 | + static <T1, T2, T3, T4, T5, T6, T7, T8, V, R> EntryFunction<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>, V, R> function(Function9<T1, T2, T3, T4, T5, T6, T7, T8, V, R> function) { |
| 39 | + return (t, v) -> function.apply(t.getT1(), t.getT2(), t.getT3(), t.getT4(), t.getT5(), t.getT6(), t.getT7(), t.getT8(), v); |
| 40 | + } |
| 41 | + |
| 42 | + |
25 | 43 | static <K, V> EntryConsumer<K, V> consumer(Consumer2<K, V> consumer2) {
|
26 | 44 | return consumer2::accept;
|
27 | 45 | }
|
|
0 commit comments