Skip to content

Commit

Permalink
tuple39
Browse files Browse the repository at this point in the history
  • Loading branch information
jyrimatti committed Jan 16, 2024
1 parent 042965a commit bf42b01
Show file tree
Hide file tree
Showing 49 changed files with 1,466 additions and 13 deletions.
10 changes: 10 additions & 0 deletions src/main/java/fi/solita/utils/functional/Apply39.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package fi.solita.utils.functional;

import java.io.Serializable;

/**
* java.util.function.Function but for 39 arguments
*/
public interface Apply39<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,R> extends Serializable {
R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22, T23 t23, T24 t24, T25 t25, T26 t26, T27 t27, T28 t28, T29 t29, T30 t30, T31 t31, T32 t32, T33 t33, T34 t34, T35 t35, T36 t36, T37 t37, T38 t38, T39 t39);
}
4 changes: 4 additions & 0 deletions src/main/java/fi/solita/utils/functional/ApplyEx.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,8 @@ public static interface Ex37<T,R,E1 extends Throwable, E2 extends Throwable, E3
public static interface Ex38<T,R,E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable, E6 extends Throwable, E7 extends Throwable, E8 extends Throwable, E9 extends Throwable, E10 extends Throwable, E11 extends Throwable, E12 extends Throwable, E13 extends Throwable, E14 extends Throwable, E15 extends Throwable, E16 extends Throwable, E17 extends Throwable, E18 extends Throwable, E19 extends Throwable, E20 extends Throwable, E21 extends Throwable, E22 extends Throwable, E23 extends Throwable, E24 extends Throwable, E25 extends Throwable, E26 extends Throwable, E27 extends Throwable, E28 extends Throwable, E29 extends Throwable, E30 extends Throwable, E31 extends Throwable, E32 extends Throwable, E33 extends Throwable, E34 extends Throwable, E35 extends Throwable, E36 extends Throwable, E37 extends Throwable, E38 extends Throwable> extends Serializable {
R apply(T t) throws E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12, E13, E14, E15, E16, E17, E18, E19, E20, E21, E22, E23, E24, E25, E26, E27, E28, E29, E30, E31, E32, E33, E34, E35, E36, E37, E38;
}

public static interface Ex39<T,R,E1 extends Throwable, E2 extends Throwable, E3 extends Throwable, E4 extends Throwable, E5 extends Throwable, E6 extends Throwable, E7 extends Throwable, E8 extends Throwable, E9 extends Throwable, E10 extends Throwable, E11 extends Throwable, E12 extends Throwable, E13 extends Throwable, E14 extends Throwable, E15 extends Throwable, E16 extends Throwable, E17 extends Throwable, E18 extends Throwable, E19 extends Throwable, E20 extends Throwable, E21 extends Throwable, E22 extends Throwable, E23 extends Throwable, E24 extends Throwable, E25 extends Throwable, E26 extends Throwable, E27 extends Throwable, E28 extends Throwable, E29 extends Throwable, E30 extends Throwable, E31 extends Throwable, E32 extends Throwable, E33 extends Throwable, E34 extends Throwable, E35 extends Throwable, E36 extends Throwable, E37 extends Throwable, E38 extends Throwable, E39 extends Throwable> extends Serializable {
R apply(T t) throws E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12, E13, E14, E15, E16, E17, E18, E19, E20, E21, E22, E23, E24, E25, E26, E27, E28, E29, E30, E31, E32, E33, E34, E35, E36, E37, E38, E39;
}
}
45 changes: 34 additions & 11 deletions src/main/java/fi/solita/utils/functional/Collections.java

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/main/java/fi/solita/utils/functional/Compare.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,10 @@ public static final <K,V extends Comparable<? super V>> Ordering<Map.Entry<K,V>>
*/
@SuppressWarnings("unchecked")
public static final Ordering<Tuple._38<? extends Comparable<?>>> by_38 = (Ordering<Tuple._38<? extends Comparable<?>>>)(Object)by(Transformers.<Comparable<?>>_38());

/**
* Ordering for 39. element of a tuple.
*/
@SuppressWarnings("unchecked")
public static final Ordering<Tuple._39<? extends Comparable<?>>> by_39 = (Ordering<Tuple._39<? extends Comparable<?>>>)(Object)by(Transformers.<Comparable<?>>_39());
}
15 changes: 15 additions & 0 deletions src/main/java/fi/solita/utils/functional/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,15 @@ public final R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9
};
}

public static final <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, R> Function39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, R> of(final Apply39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, R> apply) {
return new Function39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, R>() {
@Override
public final R apply(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22, T23 t23, T24 t24, T25 t25, T26 t26, T27 t27, T28 t28, T29 t29, T30 t30, T31 t31, T32 t32, T33 t33, T34 t34, T35 t35, T36 t36, T37 t37, T38 t38, T39 t39) {
return apply.apply(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26, t27, t28, t29, t30, t31, t32, t33, t34, t35, t36, t37, t38, t39);
}
};
}

public static final <T1, T2> Function2<T1, T2, Void> consumer(final ApplyBiVoid<T1, T2> apply) {
return new Function2<T1, T2, Void>() {
@Override
Expand Down Expand Up @@ -952,6 +961,12 @@ public final R apply(Object p1, Object p2, Object p3, Object p4, Object p5, Obje
return ff.apply(replacePlaceholders(args, t, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38));
}
};
case 39: return (FR) new Function39<Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,R>() {
@Override
public final R apply(Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9, Object p10, Object p11, Object p12, Object p13, Object p14, Object p15, Object p16, Object p17, Object p18, Object p19, Object p20, Object p21, Object p22, Object p23, Object p24, Object p25, Object p26, Object p27, Object p28, Object p29, Object p30, Object p31, Object p32, Object p33, Object p34, Object p35, Object p36, Object p37, Object p38, Object p39) {
return ff.apply(replacePlaceholders(args, t, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39));
}
};
}
throw new UnsupportedOperationException("Not implemented");
}
Expand Down
Loading

0 comments on commit bf42b01

Please sign in to comment.