diff --git a/pom.xml b/pom.xml index 1f8dcee..e74ea67 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 fi.solita.utils functional-utils - 0.12.52 + 0.12.53 diff --git a/src/main/java/fi/solita/utils/functional/Apply40.java b/src/main/java/fi/solita/utils/functional/Apply40.java new file mode 100644 index 0000000..f4a202d --- /dev/null +++ b/src/main/java/fi/solita/utils/functional/Apply40.java @@ -0,0 +1,10 @@ +package fi.solita.utils.functional; + +import java.io.Serializable; + +/** + * java.util.function.Function but for 40 arguments + */ +public interface Apply40 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, T40 t40); +} diff --git a/src/main/java/fi/solita/utils/functional/Collections.java b/src/main/java/fi/solita/utils/functional/Collections.java index ac058f0..5d1dc1a 100644 --- a/src/main/java/fi/solita/utils/functional/Collections.java +++ b/src/main/java/fi/solita/utils/functional/Collections.java @@ -541,10 +541,17 @@ public static final List newList(T e1, T e2, T e3, T e4, T e5, T e6, T e7 } /** - * @return some implementation of a list containing elements {@code e1}, {@code e2}, {@code e3}, {@code e4}, {@code e5}, {@code e6}, {@code e7}, {@code e8}, {@code e9}, {@code e10}, {@code e11}, {@code e12}, {@code e13}, {@code e14}, {@code e15}, {@code e16}, {@code e17}, {@code e18}, {@code e19}, {@code e20}, {@code e21}, {@code e22}, {@code e23}, {@code e24}, {@code e25}, {@code e26}, {@code e27}, {@code e28}, {@code e29}, {@code e30}, {@code e31}, {@code e32}, {@code e33}, {@code e34}, {@code e35}, {@code e36}, {@code e37}, {@code e38}, {@code e39} and {@code elements}. + * @return some implementation of a list containing elements {@code e1}, {@code e2}, {@code e3}, {@code e4}, {@code e5}, {@code e6}, {@code e7}, {@code e8}, {@code e9}, {@code e10}, {@code e11}, {@code e12}, {@code e13}, {@code e14}, {@code e15}, {@code e16}, {@code e17}, {@code e18}, {@code e19}, {@code e20}, {@code e21}, {@code e22}, {@code e23}, {@code e24}, {@code e25}, {@code e26}, {@code e27}, {@code e28}, {@code e29}, {@code e30}, {@code e31}, {@code e32}, {@code e33}, {@code e34}, {@code e35}, {@code e36}, {@code e37}, {@code e38} and {@code e39}. */ - public static final List newList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9, T e10, T e11, T e12, T e13, T e14, T e15, T e16, T e17, T e18, T e19, T e20, T e21, T e22, T e23, T e24, T e25, T e26, T e27, T e28, T e29, T e30, T e31, T e32, T e33, T e34, T e35, T e36, T e37, T e38, T e39, T... elements) { - return newList(concat(Arrays.asList(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), elements)); + public static final List newList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9, T e10, T e11, T e12, T e13, T e14, T e15, T e16, T e17, T e18, T e19, T e20, T e21, T e22, T e23, T e24, T e25, T e26, T e27, T e28, T e29, T e30, T e31, T e32, T e33, T e34, T e35, T e36, T e37, T e38, T e39) { + return java.util.Collections.unmodifiableList(Arrays.asList(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)); + } + + /** + * @return some implementation of a list containing elements {@code e1}, {@code e2}, {@code e3}, {@code e4}, {@code e5}, {@code e6}, {@code e7}, {@code e8}, {@code e9}, {@code e10}, {@code e11}, {@code e12}, {@code e13}, {@code e14}, {@code e15}, {@code e16}, {@code e17}, {@code e18}, {@code e19}, {@code e20}, {@code e21}, {@code e22}, {@code e23}, {@code e24}, {@code e25}, {@code e26}, {@code e27}, {@code e28}, {@code e29}, {@code e30}, {@code e31}, {@code e32}, {@code e33}, {@code e34}, {@code e35}, {@code e36}, {@code e37}, {@code e38}, {@code e39}, {@code e40} and {@code elements}. + */ + public static final List newList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9, T e10, T e11, T e12, T e13, T e14, T e15, T e16, T e17, T e18, T e19, T e20, T e21, T e22, T e23, T e24, T e25, T e26, T e27, T e28, T e29, T e30, T e31, T e32, T e33, T e34, T e35, T e36, T e37, T e38, T e39, T e40, T... elements) { + return newList(concat(Arrays.asList(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, e40), elements)); } /** @@ -880,14 +887,21 @@ public static final Set newSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, * @return some implementation of a set containing elements {@code e1}, {@code e2}, {@code e3}, {@code e4}, {@code e5}, {@code e6}, {@code e7}, {@code e8}, {@code e9}, {@code e10}, {@code e11}, {@code e12}, {@code e13}, {@code e14}, {@code e15}, {@code e16}, {@code e17}, {@code e18}, {@code e19}, {@code e20}, {@code e21}, {@code e22}, {@code e23}, {@code e24}, {@code e25}, {@code e26}, {@code e27}, {@code e28}, {@code e29}, {@code e30}, {@code e31}, {@code e32}, {@code e33}, {@code e34}, {@code e35}, {@code e36}, {@code e37} and {@code e38}. */ public static final Set newSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9, T e10, T e11, T e12, T e13, T e14, T e15, T e16, T e17, T e18, T e19, T e20, T e21, T e22, T e23, T e24, T e25, T e26, T e27, T e28, T e29, T e30, T e31, T e32, T e33, T e34, T e35, T e36, T e37, T e38) { - return newSet(Arrays.asList(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)); + return newSet(Arrays.asList(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)); } /** - * @return some implementation of a set containing elements {@code e1}, {@code e2}, {@code e3}, {@code e4}, {@code e5}, {@code e6}, {@code e7}, {@code e8}, {@code e9}, {@code e10}, {@code e11}, {@code e12}, {@code e13}, {@code e14}, {@code e15}, {@code e16}, {@code e17}, {@code e18}, {@code e19}, {@code e20}, {@code e21}, {@code e22}, {@code e23}, {@code e24}, {@code e25}, {@code e26}, {@code e27}, {@code e28}, {@code e29}, {@code e30}, {@code e31}, {@code e32}, {@code e33}, {@code e34}, {@code e35}, {@code e36}, {@code e37}, {@code e38}, {@code e39} and {@code elements}. + * @return some implementation of a set containing elements {@code e1}, {@code e2}, {@code e3}, {@code e4}, {@code e5}, {@code e6}, {@code e7}, {@code e8}, {@code e9}, {@code e10}, {@code e11}, {@code e12}, {@code e13}, {@code e14}, {@code e15}, {@code e16}, {@code e17}, {@code e18}, {@code e19}, {@code e20}, {@code e21}, {@code e22}, {@code e23}, {@code e24}, {@code e25}, {@code e26}, {@code e27}, {@code e28}, {@code e29}, {@code e30}, {@code e31}, {@code e32}, {@code e33}, {@code e34}, {@code e35}, {@code e36}, {@code e37}, {@code e38} and {@code e39}. */ - public static final Set newSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9, T e10, T e11, T e12, T e13, T e14, T e15, T e16, T e17, T e18, T e19, T e20, T e21, T e22, T e23, T e24, T e25, T e26, T e27, T e28, T e29, T e30, T e31, T e32, T e33, T e34, T e35, T e36, T e37, T e38, T e39, T... elements) { - return newSet(concat(Arrays.asList(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), elements)); + public static final Set newSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9, T e10, T e11, T e12, T e13, T e14, T e15, T e16, T e17, T e18, T e19, T e20, T e21, T e22, T e23, T e24, T e25, T e26, T e27, T e28, T e29, T e30, T e31, T e32, T e33, T e34, T e35, T e36, T e37, T e38, T e39) { + return newSet(Arrays.asList(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)); + } + + /** + * @return some implementation of a set containing elements {@code e1}, {@code e2}, {@code e3}, {@code e4}, {@code e5}, {@code e6}, {@code e7}, {@code e8}, {@code e9}, {@code e10}, {@code e11}, {@code e12}, {@code e13}, {@code e14}, {@code e15}, {@code e16}, {@code e17}, {@code e18}, {@code e19}, {@code e20}, {@code e21}, {@code e22}, {@code e23}, {@code e24}, {@code e25}, {@code e26}, {@code e27}, {@code e28}, {@code e29}, {@code e30}, {@code e31}, {@code e32}, {@code e33}, {@code e34}, {@code e35}, {@code e36}, {@code e37}, {@code e38}, {@code e39}, {@code e40} and {@code elements}. + */ + public static final Set newSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9, T e10, T e11, T e12, T e13, T e14, T e15, T e16, T e17, T e18, T e19, T e20, T e21, T e22, T e23, T e24, T e25, T e26, T e27, T e28, T e29, T e30, T e31, T e32, T e33, T e34, T e35, T e36, T e37, T e38, T e39, T e40, T... elements) { + return newSet(concat(Arrays.asList(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, e40), elements)); } private static final Class unmodifiableListClass = java.util.Collections.unmodifiableList(emptyList()).getClass(); @@ -1469,10 +1483,19 @@ public static final Map newMap(Map.Entry /** * Unsafe! Fails if given duplicate keys. * - * @return some implementation of a Map containing elements {@code e1}, {@code e2}, {@code e3}, {@code e4}, {@code e5}, {@code e6}, {@code e7}, {@code e8}, {@code e9}, {@code e10}, {@code e11}, {@code e12}, {@code e13}, {@code e14}, {@code e15}, {@code e16}, {@code e17}, {@code e18}, {@code e19}, {@code e20}, {@code e21}, {@code e22}, {@code e23}, {@code e24}, {@code e25}, {@code e26}, {@code e27}, {@code e28}, {@code e29}, {@code e30}, {@code e31}, {@code e32}, {@code e33}, {@code e34}, {@code e35}, {@code e36}, {@code e37}, {@code e38}, {@code e39} and {@code elements}. + * @return some implementation of a Map containing elements {@code e1}, {@code e2}, {@code e3}, {@code e4}, {@code e5}, {@code e6}, {@code e7}, {@code e8}, {@code e9}, {@code e10}, {@code e11}, {@code e12}, {@code e13}, {@code e14}, {@code e15}, {@code e16}, {@code e17}, {@code e18}, {@code e19}, {@code e20}, {@code e21}, {@code e22}, {@code e23}, {@code e24}, {@code e25}, {@code e26}, {@code e27}, {@code e28}, {@code e29}, {@code e30}, {@code e31}, {@code e32}, {@code e33}, {@code e34}, {@code e35}, {@code e36}, {@code e37}, {@code e38} and {@code e39}. + */ + public static final Map newMap(Map.Entry e1, Map.Entry e2, Map.Entry e3, Map.Entry e4, Map.Entry e5, Map.Entry e6, Map.Entry e7, Map.Entry e8, Map.Entry e9, Map.Entry e10, Map.Entry e11, Map.Entry e12, Map.Entry e13, Map.Entry e14, Map.Entry e15, Map.Entry e16, Map.Entry e17, Map.Entry e18, Map.Entry e19, Map.Entry e20, Map.Entry e21, Map.Entry e22, Map.Entry e23, Map.Entry e24, Map.Entry e25, Map.Entry e26, Map.Entry e27, Map.Entry e28, Map.Entry e29, Map.Entry e30, Map.Entry e31, Map.Entry e32, Map.Entry e33, Map.Entry e34, Map.Entry e35, Map.Entry e36, Map.Entry e37, Map.Entry e38, Map.Entry e39) { + return newMap(SemiGroups.fail(), Arrays.asList(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)); + } + + /** + * Unsafe! Fails if given duplicate keys. + * + * @return some implementation of a Map containing elements {@code e1}, {@code e2}, {@code e3}, {@code e4}, {@code e5}, {@code e6}, {@code e7}, {@code e8}, {@code e9}, {@code e10}, {@code e11}, {@code e12}, {@code e13}, {@code e14}, {@code e15}, {@code e16}, {@code e17}, {@code e18}, {@code e19}, {@code e20}, {@code e21}, {@code e22}, {@code e23}, {@code e24}, {@code e25}, {@code e26}, {@code e27}, {@code e28}, {@code e29}, {@code e30}, {@code e31}, {@code e32}, {@code e33}, {@code e34}, {@code e35}, {@code e36}, {@code e37}, {@code e38}, {@code e39}, {@code e40} and {@code elements}. */ - public static final Map newMap(Map.Entry e1, Map.Entry e2, Map.Entry e3, Map.Entry e4, Map.Entry e5, Map.Entry e6, Map.Entry e7, Map.Entry e8, Map.Entry e9, Map.Entry e10, Map.Entry e11, Map.Entry e12, Map.Entry e13, Map.Entry e14, Map.Entry e15, Map.Entry e16, Map.Entry e17, Map.Entry e18, Map.Entry e19, Map.Entry e20, Map.Entry e21, Map.Entry e22, Map.Entry e23, Map.Entry e24, Map.Entry e25, Map.Entry e26, Map.Entry e27, Map.Entry e28, Map.Entry e29, Map.Entry e30, Map.Entry e31, Map.Entry e32, Map.Entry e33, Map.Entry e34, Map.Entry e35, Map.Entry e36, Map.Entry e37, Map.Entry e38, Map.Entry e39, Map.Entry... elements) { - return newMap(SemiGroups.fail(), concat(Arrays.asList(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), elements)); + public static final Map newMap(Map.Entry e1, Map.Entry e2, Map.Entry e3, Map.Entry e4, Map.Entry e5, Map.Entry e6, Map.Entry e7, Map.Entry e8, Map.Entry e9, Map.Entry e10, Map.Entry e11, Map.Entry e12, Map.Entry e13, Map.Entry e14, Map.Entry e15, Map.Entry e16, Map.Entry e17, Map.Entry e18, Map.Entry e19, Map.Entry e20, Map.Entry e21, Map.Entry e22, Map.Entry e23, Map.Entry e24, Map.Entry e25, Map.Entry e26, Map.Entry e27, Map.Entry e28, Map.Entry e29, Map.Entry e30, Map.Entry e31, Map.Entry e32, Map.Entry e33, Map.Entry e34, Map.Entry e35, Map.Entry e36, Map.Entry e37, Map.Entry e38, Map.Entry e39, Map.Entry e40, Map.Entry... elements) { + return newMap(SemiGroups.fail(), concat(Arrays.asList(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, e40), elements)); } /** diff --git a/src/main/java/fi/solita/utils/functional/Compare.java b/src/main/java/fi/solita/utils/functional/Compare.java index 084d453..20b29ef 100644 --- a/src/main/java/fi/solita/utils/functional/Compare.java +++ b/src/main/java/fi/solita/utils/functional/Compare.java @@ -394,4 +394,10 @@ public static final > Ordering> */ @SuppressWarnings("unchecked") public static final Ordering>> by_39 = (Ordering>>)(Object)by(Transformers.>_39()); + + /** + * Ordering for 40. element of a tuple. + */ + @SuppressWarnings("unchecked") + public static final Ordering>> by_40 = (Ordering>>)(Object)by(Transformers.>_40()); } diff --git a/src/main/java/fi/solita/utils/functional/Function.java b/src/main/java/fi/solita/utils/functional/Function.java index e720537..c851bd3 100644 --- a/src/main/java/fi/solita/utils/functional/Function.java +++ b/src/main/java/fi/solita/utils/functional/Function.java @@ -394,6 +394,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 Function40 of(final Apply40 apply) { + return new Function40() { + @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, T40 t40) { + 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, t40); + } + }; + } + public static final Function2 consumer(final ApplyBiVoid apply) { return new Function2() { @Override @@ -967,6 +976,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, p39)); } }; + case 40: return (FR) new Function40() { + @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, Object p40) { + 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, p40)); + } + }; } throw new UnsupportedOperationException("Not implemented"); } diff --git a/src/main/java/fi/solita/utils/functional/Function40.java b/src/main/java/fi/solita/utils/functional/Function40.java new file mode 100644 index 0000000..d58734b --- /dev/null +++ b/src/main/java/fi/solita/utils/functional/Function40.java @@ -0,0 +1,223 @@ +package fi.solita.utils.functional; + +public abstract class Function40 extends MultiParamFunction, R, T1> { + + public abstract 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, T40 t40); + + @Override + public final Function40 andThen(final Apply next) { + final Function40 self = this; + return new Function40() { + @Override + public U 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, T40 t40) { + return next.apply(self.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, t40)); + } + }; + } + + @Override + public final Function1, R> tuppled() { + return new Function1, R>() { + @Override + public R apply(Tuple40 t) { + return Function40.this.apply(t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30, t._31, t._32, t._33, t._34, t._35, t._36, t._37, t._38, t._39, t._40); + } + }; + } + + @Override + public Function1>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> curried() { + return new Function1>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>() { + @Override + public Function1>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> apply(final T1 t1) { + return new Function39() { + @Override + public R apply(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, T40 t40) { + return Function40.this.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, t40); + } + }.curried(); + } + }; + } + + public final Function1 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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 ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29).ap(t30).ap(t31).ap(t32).ap(t33).ap(t34).ap(t35).ap(t36).ap(t37).ap(t38).ap(t39); + } + + public final Function2 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29).ap(t30).ap(t31).ap(t32).ap(t33).ap(t34).ap(t35).ap(t36).ap(t37).ap(t38); + } + + public final Function3 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29).ap(t30).ap(t31).ap(t32).ap(t33).ap(t34).ap(t35).ap(t36).ap(t37); + } + + public final Function4 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29).ap(t30).ap(t31).ap(t32).ap(t33).ap(t34).ap(t35).ap(t36); + } + + public final Function5 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29).ap(t30).ap(t31).ap(t32).ap(t33).ap(t34).ap(t35); + } + + public final Function6 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29).ap(t30).ap(t31).ap(t32).ap(t33).ap(t34); + } + + public final Function7 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29).ap(t30).ap(t31).ap(t32).ap(t33); + } + + public final Function8 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29).ap(t30).ap(t31).ap(t32); + } + + public final Function9 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29).ap(t30).ap(t31); + } + + public final Function10 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29).ap(t30); + } + + public final Function11 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28).ap(t29); + } + + public final Function12 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27).ap(t28); + } + + public final Function13 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26).ap(t27); + } + + public final Function14 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25).ap(t26); + } + + public final Function15 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final 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) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24).ap(t25); + } + + public final Function16 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22, T23 t23, T24 t24) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23).ap(t24); + } + + public final Function17 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22, T23 t23) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22).ap(t23); + } + + public final Function18 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21, T22 t22) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21).ap(t22); + } + + public final Function19 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20, T21 t21) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20).ap(t21); + } + + public final Function20 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19, T20 t20) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19).ap(t20); + } + + public final Function21 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18, T19 t19) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18).ap(t19); + } + + public final Function22 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14, T15 t15, T16 t16, T17 t17, T18 t18) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17).ap(t18); + } + + public final Function23 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14, T15 t15, T16 t16, T17 t17) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16).ap(t17); + } + + public final Function24 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14, T15 t15, T16 t16) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15).ap(t16); + } + + public final Function25 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14, T15 t15) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14).ap(t15); + } + + public final Function26 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13, T14 t14) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13).ap(t14); + } + + public final Function27 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12, final T13 t13) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12).ap(t13); + } + + public final Function28 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11, final T12 t12) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11).ap(t12); + } + + public final Function29 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10, final T11 t11) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10).ap(t11); + } + + public final Function30 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9, final T10 t10) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9).ap(t10); + } + + public final Function31 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8, final T9 t9) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8).ap(t9); + } + + public final Function32 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7, final T8 t8) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7).ap(t8); + } + + public final Function33 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6, final T7 t7) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6).ap(t7); + } + + public final Function34 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5, final T6 t6) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5).ap(t6); + } + + public final Function35 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4, final T5 t5) { + return ap(t1).ap(t2).ap(t3).ap(t4).ap(t5); + } + + public final Function36 ap(final T1 t1, final T2 t2, final T3 t3, final T4 t4) { + return ap(t1).ap(t2).ap(t3).ap(t4); + } + + public final Function37 ap(final T1 t1, final T2 t2, final T3 t3) { + return ap(t1).ap(t2).ap(t3); + } + + public final Function38 ap(final T1 t1, final T2 t2) { + return ap(t1).ap(t2); + } + + @Override + public final Function39 ap(final T1 t) { + return new Function39() { + @Override + public R apply(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, T40 t40) { + return Function40.this.apply(t, 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, t40); + } + }; + } + + static final Function40 partial(final Apply f, final Object... paramsAndPlaceholders) { + return new Function40() { + @SuppressWarnings("unchecked") + @Override + public 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, T40 t40) { + return PartialApplicationHelper.doApply((Apply)f, paramsAndPlaceholders, 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, t40); + } + }; + } + + static final > Function40 split(final Apply f, final Object... placeholders) { + return new Function40() { + @Override + public FR 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, T40 t40) { + return PartialApplicationHelper.makeSecondFunc(f, placeholders, 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, t40); + } + }; + } +} diff --git a/src/main/java/fi/solita/utils/functional/Transformers.java b/src/main/java/fi/solita/utils/functional/Transformers.java index 35099e2..168705d 100644 --- a/src/main/java/fi/solita/utils/functional/Transformers.java +++ b/src/main/java/fi/solita/utils/functional/Transformers.java @@ -218,6 +218,24 @@ public static final Transformer,T> right() { public static final Transformer,V> value() { return (Transformer,V>)(Object)right; } + + public static final Transformer,Map.Entry> first(final Apply f) { + return new Transformer,Map.Entry>() { + @Override + public final Map.Entry transform(Map.Entry source) { + return Pair.of(f.apply(source.getKey()), source.getValue()); + } + }; + } + + public static final Transformer,Map.Entry> second(final Apply f) { + return new Transformer,Map.Entry>() { + @Override + public final Map.Entry transform(Map.Entry source) { + return Pair.of(source.getKey(), f.apply(source.getValue())); + } + }; + } private static final Transformer,Option> eitherLeft = new Transformer,Option>() { @Override @@ -691,6 +709,12 @@ public final Object transform(fi.solita.utils.functional.Tuple._39 source) { return source.get_39(); } }; + private static final Transformer,?> _40 = new Transformer,Object>() { + @Override + public final Object transform(fi.solita.utils.functional.Tuple._40 source) { + return source.get_40(); + } + }; @SuppressWarnings("unchecked") public static final Transformer,T> _1() { @@ -848,4 +872,8 @@ public static final Transformer,T> _38() { public static final Transformer,T> _39() { return (Transformer,T>)(Object)_39; } + @SuppressWarnings("unchecked") + public static final Transformer,T> _40() { + return (Transformer,T>)(Object)_40; + } } diff --git a/src/main/java/fi/solita/utils/functional/Tuple.java b/src/main/java/fi/solita/utils/functional/Tuple.java index d00590e..1ca9f0f 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple.java +++ b/src/main/java/fi/solita/utils/functional/Tuple.java @@ -295,6 +295,13 @@ public static List asList(Tuple39 List asList(Tuple40 tuple) { + return Arrays.asList(tuple._1, tuple._2, tuple._3, tuple._4, tuple._5, tuple._6, tuple._7, tuple._8, tuple._9, tuple._10, tuple._11, tuple._12, tuple._13, tuple._14, tuple._15, tuple._16, tuple._17, tuple._18, tuple._19, tuple._20, tuple._21, tuple._22, tuple._23, tuple._24, tuple._25, tuple._26, tuple._27, tuple._28, tuple._29, tuple._30, tuple._31, tuple._32, tuple._33, tuple._34, tuple._35, tuple._36, tuple._37, tuple._38, tuple._39, tuple._40); + } + /** * Unsafe! Will fail if given more than 32 arguments. * @@ -342,6 +349,7 @@ public static Tuple of(Object... ts) { case 37: return Tuple.of(ts[0], ts[1], ts[2], ts[3], ts[4], ts[5], ts[6], ts[7], ts[8], ts[9], ts[10], ts[11], ts[12], ts[13], ts[14], ts[15], ts[16], ts[17], ts[18], ts[19], ts[20], ts[21], ts[22], ts[23], ts[24], ts[25], ts[26], ts[27], ts[28], ts[29], ts[30], ts[31], ts[32], ts[33], ts[34], ts[35], ts[36]); case 38: return Tuple.of(ts[0], ts[1], ts[2], ts[3], ts[4], ts[5], ts[6], ts[7], ts[8], ts[9], ts[10], ts[11], ts[12], ts[13], ts[14], ts[15], ts[16], ts[17], ts[18], ts[19], ts[20], ts[21], ts[22], ts[23], ts[24], ts[25], ts[26], ts[27], ts[28], ts[29], ts[30], ts[31], ts[32], ts[33], ts[34], ts[35], ts[36], ts[37]); case 39: return Tuple.of(ts[0], ts[1], ts[2], ts[3], ts[4], ts[5], ts[6], ts[7], ts[8], ts[9], ts[10], ts[11], ts[12], ts[13], ts[14], ts[15], ts[16], ts[17], ts[18], ts[19], ts[20], ts[21], ts[22], ts[23], ts[24], ts[25], ts[26], ts[27], ts[28], ts[29], ts[30], ts[31], ts[32], ts[33], ts[34], ts[35], ts[36], ts[37], ts[38]); + case 40: return Tuple.of(ts[0], ts[1], ts[2], ts[3], ts[4], ts[5], ts[6], ts[7], ts[8], ts[9], ts[10], ts[11], ts[12], ts[13], ts[14], ts[15], ts[16], ts[17], ts[18], ts[19], ts[20], ts[21], ts[22], ts[23], ts[24], ts[25], ts[26], ts[27], ts[28], ts[29], ts[30], ts[31], ts[32], ts[33], ts[34], ts[35], ts[36], ts[37], ts[38], ts[39]); } throw new UnsupportedOperationException("Tuple40 not implemented"); } @@ -626,6 +634,13 @@ public static (_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); } + /** + * @return tuple of given arguments. + */ + public static Tuple40 of(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5, T6 _6, T7 _7, T8 _8, T9 _9, T10 _10, T11 _11, T12 _12, T13 _13, T14 _14, T15 _15, T16 _16, T17 _17, T18 _18, T19 _19, T20 _20, T21 _21, T22 _22, T23 _23, T24 _24, T25 _25, T26 _26, T27 _27, T28 _28, T29 _29, T30 _30, T31 _31, T32 _32, T33 _33, T34 _34, T35 _35, T36 _36, T37 _37, T38 _38, T39 _39, T40 _40) { + return new Tuple40(_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); + } + public static interface _1 { /** * @return value in position 1. Normally you should use field {@code _1} instead. @@ -899,6 +914,13 @@ public static interface _39 { T get_39(); } + public static interface _40 { + /** + * @return value in position 40. Normally you should use field {@code _40} instead. + */ + T get_40(); + } + public static interface Tailable { T drop1(); } diff --git a/src/main/java/fi/solita/utils/functional/Tuple1.java b/src/main/java/fi/solita/utils/functional/Tuple1.java index 9ee2e44..e19398e 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple1.java +++ b/src/main/java/fi/solita/utils/functional/Tuple1.java @@ -289,6 +289,13 @@ public Tuple40 join(Tuple39 t) { + return Tuple.of(_1, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30, t._31, t._32, t._33, t._34, t._35, t._36, t._37, t._38, t._39); + } + public T1 get_1() { return _1; } diff --git a/src/main/java/fi/solita/utils/functional/Tuple10.java b/src/main/java/fi/solita/utils/functional/Tuple10.java index 4dd40a4..e7f618f 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple10.java +++ b/src/main/java/fi/solita/utils/functional/Tuple10.java @@ -243,6 +243,13 @@ public Tuple39 join(Tuple29 t) { return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29); } + + /** + * @return this tuple with {@code t} joined to the right. + */ + public Tuple40 join(Tuple30 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30); + } /** * @return a prefix of this tuple. diff --git a/src/main/java/fi/solita/utils/functional/Tuple11.java b/src/main/java/fi/solita/utils/functional/Tuple11.java index 8ca1996..a07bd57 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple11.java +++ b/src/main/java/fi/solita/utils/functional/Tuple11.java @@ -239,6 +239,13 @@ public Tuple40 join(Tuple29 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple12.java b/src/main/java/fi/solita/utils/functional/Tuple12.java index 217386a..bf441d5 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple12.java +++ b/src/main/java/fi/solita/utils/functional/Tuple12.java @@ -234,6 +234,13 @@ public Tuple40 join(Tuple28 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple13.java b/src/main/java/fi/solita/utils/functional/Tuple13.java index 2f29548..d33036c 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple13.java +++ b/src/main/java/fi/solita/utils/functional/Tuple13.java @@ -229,6 +229,13 @@ public Tuple40 join(Tuple27 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple14.java b/src/main/java/fi/solita/utils/functional/Tuple14.java index 64e49cb..f0c26d8 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple14.java +++ b/src/main/java/fi/solita/utils/functional/Tuple14.java @@ -224,6 +224,13 @@ public Tuple40 join(Tuple26 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple15.java b/src/main/java/fi/solita/utils/functional/Tuple15.java index 1afcd36..3a5a8c0 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple15.java +++ b/src/main/java/fi/solita/utils/functional/Tuple15.java @@ -219,6 +219,13 @@ public Tuple40 join(Tuple25 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple16.java b/src/main/java/fi/solita/utils/functional/Tuple16.java index f1a4e8e..fe24cbd 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple16.java +++ b/src/main/java/fi/solita/utils/functional/Tuple16.java @@ -214,6 +214,13 @@ public Tuple40 join(Tuple24 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple17.java b/src/main/java/fi/solita/utils/functional/Tuple17.java index 22fa6ed..93170b7 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple17.java +++ b/src/main/java/fi/solita/utils/functional/Tuple17.java @@ -209,6 +209,13 @@ public Tuple40 join(Tuple23 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple18.java b/src/main/java/fi/solita/utils/functional/Tuple18.java index b99532f..99482b1 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple18.java +++ b/src/main/java/fi/solita/utils/functional/Tuple18.java @@ -204,6 +204,13 @@ public Tuple40 join(Tuple22 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple19.java b/src/main/java/fi/solita/utils/functional/Tuple19.java index 3c833d3..f4e6a9e 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple19.java +++ b/src/main/java/fi/solita/utils/functional/Tuple19.java @@ -199,6 +199,13 @@ public return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20); } + /** + * @return this tuple with {@code t} joined to the right. + */ + public Tuple40 join(Tuple21 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple2.java b/src/main/java/fi/solita/utils/functional/Tuple2.java index b56426c..5bff75e 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple2.java +++ b/src/main/java/fi/solita/utils/functional/Tuple2.java @@ -309,6 +309,13 @@ public Tuple40 join(Tuple38 t) { + return Tuple.of(_1, _2, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30, t._31, t._32, t._33, t._34, t._35, t._36, t._37, t._38); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple20.java b/src/main/java/fi/solita/utils/functional/Tuple20.java index f3c3691..c0c52fc 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple20.java +++ b/src/main/java/fi/solita/utils/functional/Tuple20.java @@ -194,6 +194,13 @@ public Tupl return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19); } + /** + * @return this tuple with {@code t} joined to the right. + */ + public Tuple40 join(Tuple20 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple21.java b/src/main/java/fi/solita/utils/functional/Tuple21.java index f13535b..965a02d 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple21.java +++ b/src/main/java/fi/solita/utils/functional/Tuple21.java @@ -189,6 +189,13 @@ public Tuple39< return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18); } + /** + * @return this tuple with {@code t} joined to the right. + */ + public Tuple40 join(Tuple19 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple22.java b/src/main/java/fi/solita/utils/functional/Tuple22.java index 6ed04b7..eb0eb39 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple22.java +++ b/src/main/java/fi/solita/utils/functional/Tuple22.java @@ -184,6 +184,13 @@ public Tuple39 Tuple40 join(Tuple18 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple23.java b/src/main/java/fi/solita/utils/functional/Tuple23.java index 1bb43e4..8cdd507 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple23.java +++ b/src/main/java/fi/solita/utils/functional/Tuple23.java @@ -179,6 +179,13 @@ public Tuple39 Tuple40 join(Tuple17 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple24.java b/src/main/java/fi/solita/utils/functional/Tuple24.java index 2030e53..f18f463 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple24.java +++ b/src/main/java/fi/solita/utils/functional/Tuple24.java @@ -174,6 +174,13 @@ public Tuple39 Tuple40 join(Tuple16 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple25.java b/src/main/java/fi/solita/utils/functional/Tuple25.java index c1fb929..31d92ba 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple25.java +++ b/src/main/java/fi/solita/utils/functional/Tuple25.java @@ -169,6 +169,13 @@ public Tuple39 Tuple40 join(Tuple15 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple26.java b/src/main/java/fi/solita/utils/functional/Tuple26.java index 27acb89..ded0f49 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple26.java +++ b/src/main/java/fi/solita/utils/functional/Tuple26.java @@ -164,6 +164,13 @@ public Tuple39 Tuple40 join(Tuple14 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple27.java b/src/main/java/fi/solita/utils/functional/Tuple27.java index 1c2654f..785e22e 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple27.java +++ b/src/main/java/fi/solita/utils/functional/Tuple27.java @@ -159,6 +159,13 @@ public Tuple39 Tuple40 join(Tuple13 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13); + } + /** * @return a prefix of this tuple. diff --git a/src/main/java/fi/solita/utils/functional/Tuple28.java b/src/main/java/fi/solita/utils/functional/Tuple28.java index f244723..c4a0be2 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple28.java +++ b/src/main/java/fi/solita/utils/functional/Tuple28.java @@ -154,6 +154,13 @@ public Tuple39 Tuple40 join(Tuple12 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple29.java b/src/main/java/fi/solita/utils/functional/Tuple29.java index 0f84f40..06d9f91 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple29.java +++ b/src/main/java/fi/solita/utils/functional/Tuple29.java @@ -149,6 +149,13 @@ public Tuple39 Tuple40 join(Tuple11 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple3.java b/src/main/java/fi/solita/utils/functional/Tuple3.java index dc497ac..a20f4a6 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple3.java +++ b/src/main/java/fi/solita/utils/functional/Tuple3.java @@ -279,6 +279,13 @@ public Tuple40 join(Tuple37 t) { + return Tuple.of(_1, _2, _3, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30, t._31, t._32, t._33, t._34, t._35, t._36, t._37); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple30.java b/src/main/java/fi/solita/utils/functional/Tuple30.java index 2f52cb1..7789126 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple30.java +++ b/src/main/java/fi/solita/utils/functional/Tuple30.java @@ -144,6 +144,13 @@ public Tuple39 Tuple40 join(Tuple10 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple31.java b/src/main/java/fi/solita/utils/functional/Tuple31.java index 1f027d4..7af608e 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple31.java +++ b/src/main/java/fi/solita/utils/functional/Tuple31.java @@ -139,6 +139,13 @@ public Tuple39 Tuple40 join(Tuple9 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple32.java b/src/main/java/fi/solita/utils/functional/Tuple32.java index ac25a98..d39c97e 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple32.java +++ b/src/main/java/fi/solita/utils/functional/Tuple32.java @@ -134,6 +134,13 @@ public Tuple39 Tuple40 join(Tuple8 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple33.java b/src/main/java/fi/solita/utils/functional/Tuple33.java index a58c005..1c998d7 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple33.java +++ b/src/main/java/fi/solita/utils/functional/Tuple33.java @@ -129,6 +129,13 @@ public Tuple39 Tuple40 join(Tuple7 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5, t._6, t._7); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple34.java b/src/main/java/fi/solita/utils/functional/Tuple34.java index a2b25ad..259ecd4 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple34.java +++ b/src/main/java/fi/solita/utils/functional/Tuple34.java @@ -124,6 +124,13 @@ public Tuple39 Tuple40 join(Tuple6 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5, t._6); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple35.java b/src/main/java/fi/solita/utils/functional/Tuple35.java index eba9486..9560e70 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple35.java +++ b/src/main/java/fi/solita/utils/functional/Tuple35.java @@ -119,6 +119,13 @@ public Tuple39 Tuple40 join(Tuple5 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4, t._5); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple36.java b/src/main/java/fi/solita/utils/functional/Tuple36.java index a58230e..5812705 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple36.java +++ b/src/main/java/fi/solita/utils/functional/Tuple36.java @@ -114,6 +114,13 @@ public Tuple39 Tuple40 join(Tuple4 t) { + return Tuple.of(_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, t._1, t._2, t._3, t._4); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple37.java b/src/main/java/fi/solita/utils/functional/Tuple37.java index c72f656..4c76e34 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple37.java +++ b/src/main/java/fi/solita/utils/functional/Tuple37.java @@ -109,6 +109,13 @@ public Tuple39 Tuple40 join(Tuple3 t) { + return Tuple.of(_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, t._1, t._2, t._3); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple38.java b/src/main/java/fi/solita/utils/functional/Tuple38.java index 8ecb185..4fa569b 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple38.java +++ b/src/main/java/fi/solita/utils/functional/Tuple38.java @@ -104,6 +104,13 @@ public Tuple38 Tuple39 join(Tuple2 t) { + return Tuple.of(_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, t._1, t._2); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple39.java b/src/main/java/fi/solita/utils/functional/Tuple39.java index 1e6ce25..81b3226 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple39.java +++ b/src/main/java/fi/solita/utils/functional/Tuple39.java @@ -85,6 +85,27 @@ public Tuple39(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5, T6 _6, T7 _7, T8 _8, T9 _9, T1 this._39 = _39; } + /** + * @return this tuple with {@code t} prepended to the left. + */ + public Tuple40 prepend(T t) { + return Tuple.of(t, _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); + } + + /** + * @return this tuple with {@code t} appended to the right. + */ + public Tuple40 append(T t) { + return Tuple.of(_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, t); + } + + /** + * @return this tuple with {@code t} joined to the right. + */ + public Tuple40 join(Tuple1 t) { + return Tuple.of(_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, t._1); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple4.java b/src/main/java/fi/solita/utils/functional/Tuple4.java index fbb2063..91159dc 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple4.java +++ b/src/main/java/fi/solita/utils/functional/Tuple4.java @@ -274,6 +274,13 @@ public Tuple40 join(Tuple36 t) { + return Tuple.of(_1, _2, _3, _4, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30, t._31, t._32, t._33, t._34, t._35, t._36); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple40.java b/src/main/java/fi/solita/utils/functional/Tuple40.java new file mode 100644 index 0000000..a66d874 --- /dev/null +++ b/src/main/java/fi/solita/utils/functional/Tuple40.java @@ -0,0 +1,820 @@ +package fi.solita.utils.functional; + + +public class Tuple40 extends Tuple implements Tuple.Tailable>, Tuple._1, Tuple._2, Tuple._3, Tuple._4, Tuple._5, Tuple._6, Tuple._7, Tuple._8, Tuple._9, Tuple._10, Tuple._11, Tuple._12, Tuple._13, Tuple._14, Tuple._15, Tuple._16, Tuple._17, Tuple._18, Tuple._19, Tuple._20, Tuple._21, Tuple._22, Tuple._23, Tuple._24, Tuple._25, Tuple._26, Tuple._27, Tuple._28, Tuple._29, Tuple._30, Tuple._31, Tuple._32, Tuple._33, Tuple._34, Tuple._35, Tuple._36, Tuple._37, Tuple._38, Tuple._39, Tuple._40 { + + public final T1 _1; + public final T2 _2; + public final T3 _3; + public final T4 _4; + public final T5 _5; + public final T6 _6; + public final T7 _7; + public final T8 _8; + public final T9 _9; + public final T10 _10; + public final T11 _11; + public final T12 _12; + public final T13 _13; + public final T14 _14; + public final T15 _15; + public final T16 _16; + public final T17 _17; + public final T18 _18; + public final T19 _19; + public final T20 _20; + public final T21 _21; + public final T22 _22; + public final T23 _23; + public final T24 _24; + public final T25 _25; + public final T26 _26; + public final T27 _27; + public final T28 _28; + public final T29 _29; + public final T30 _30; + public final T31 _31; + public final T32 _32; + public final T33 _33; + public final T34 _34; + public final T35 _35; + public final T36 _36; + public final T37 _37; + public final T38 _38; + public final T39 _39; + public final T40 _40; + + public Tuple40(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5, T6 _6, T7 _7, T8 _8, T9 _9, T10 _10, T11 _11, T12 _12, T13 _13, T14 _14, T15 _15, T16 _16, T17 _17, T18 _18, T19 _19, T20 _20, T21 _21, T22 _22, T23 _23, T24 _24, T25 _25, T26 _26, T27 _27, T28 _28, T29 _29, T30 _30, T31 _31, T32 _32, T33 _33, T34 _34, T35 _35, T36 _36, T37 _37, T38 _38, T39 _39, T40 _40) { + this._1 = _1; + this._2 = _2; + this._3 = _3; + this._4 = _4; + this._5 = _5; + this._6 = _6; + this._7 = _7; + this._8 = _8; + this._9 = _9; + this._10 = _10; + this._11 = _11; + this._12 = _12; + this._13 = _13; + this._14 = _14; + this._15 = _15; + this._16 = _16; + this._17 = _17; + this._18 = _18; + this._19 = _19; + this._20 = _20; + this._21 = _21; + this._22 = _22; + this._23 = _23; + this._24 = _24; + this._25 = _25; + this._26 = _26; + this._27 = _27; + this._28 = _28; + this._29 = _29; + this._30 = _30; + this._31 = _31; + this._32 = _32; + this._33 = _33; + this._34 = _34; + this._35 = _35; + this._36 = _36; + this._37 = _37; + this._38 = _38; + this._39 = _39; + this._40 = _40; + } + + /** + * @return a prefix of this tuple. + */ + public Tuple1 take1() { + return Tuple.of(_1); + } + + /** + * @return a prefix of this tuple. + */ + public Pair take2() { + return Pair.of(_1, _2); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple3 take3() { + return Tuple.of(_1, _2, _3); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple4 take4() { + return Tuple.of(_1, _2, _3, _4); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple5 take5() { + return Tuple.of(_1, _2, _3, _4, _5); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple6 take6() { + return Tuple.of(_1, _2, _3, _4, _5, _6); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple7 take7() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple8 take8() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple9 take9() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple10 take10() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple11 take11() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple12 take12() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple13 take13() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple14 take14() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple15 take15() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple16 take16() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple17 take17() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple18 take18() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple19 take19() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple20 take20() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple21 take21() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple22 take22() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple23 take23() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple24 take24() { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple25 take25() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple26 take26() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple27 take27() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple28 take28() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple29 take29() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple30 take30() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple31 take31() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple32 take32() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple33 take33() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple34 take34() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple35 take35() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple36 take36() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple37 take37() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple38 take38() { + return Tuple.of(_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); + } + + /** + * @return a prefix of this tuple. + */ + public Tuple39 take39() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple39 drop1() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple38 drop2() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple37 drop3() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple36 drop4() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple35 drop5() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple34 drop6() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple33 drop7() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple32 drop8() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple31 drop9() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple30 drop10() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple29 drop11() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple28 drop12() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple27 drop13() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple26 drop14() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple25 drop15() { + return Tuple.of(_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); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple24 drop16() { + return Tuple.of(_17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple23 drop17() { + return Tuple.of(_18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple22 drop18() { + return Tuple.of(_19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple21 drop19() { + return Tuple.of(_20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple20 drop20() { + return Tuple.of(_21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple19 drop21() { + return Tuple.of(_22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple18 drop22() { + return Tuple.of(_23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple17 drop23() { + return Tuple.of(_24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple16 drop24() { + return Tuple.of(_25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple15 drop25() { + return Tuple.of(_26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple14 drop26() { + return Tuple.of(_27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple13 drop27() { + return Tuple.of(_28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple12 drop28() { + return Tuple.of(_29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple11 drop29() { + return Tuple.of(_30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple10 drop30() { + return Pair.of(_31, _32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple9 drop31() { + return Pair.of(_32, _33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple8 drop32() { + return Pair.of(_33, _34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple7 drop33() { + return Tuple.of(_34, _35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple6 drop34() { + return Tuple.of(_35, _36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple5 drop35() { + return Tuple.of(_36, _37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple4 drop36() { + return Pair.of(_37, _38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple3 drop37() { + return Tuple.of(_38, _39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Pair drop38() { + return Pair.of(_39, _40); + } + + /** + * @return a suffix of this tuple. + */ + public Tuple1 drop39() { + return Tuple.of(_40); + } + + public T1 get_1() { + return _1; + } + + + public T2 get_2() { + return _2; + } + + + public T3 get_3() { + return _3; + } + + + public T4 get_4() { + return _4; + } + + + public T5 get_5() { + return _5; + } + + + public T6 get_6() { + return _6; + } + + + public T7 get_7() { + return _7; + } + + + public T8 get_8() { + return _8; + } + + + public T9 get_9() { + return _9; + } + + + public T10 get_10() { + return _10; + } + + + public T11 get_11() { + return _11; + } + + + public T12 get_12() { + return _12; + } + + + public T13 get_13() { + return _13; + } + + + public T14 get_14() { + return _14; + } + + + public T15 get_15() { + return _15; + } + + + public T16 get_16() { + return _16; + } + + + public T17 get_17() { + return _17; + } + + + public T18 get_18() { + return _18; + } + + + public T19 get_19() { + return _19; + } + + + public T20 get_20() { + return _20; + } + + + public T21 get_21() { + return _21; + } + + + public T22 get_22() { + return _22; + } + + public T23 get_23() { + return _23; + } + + public T24 get_24() { + return _24; + } + + public T25 get_25() { + return _25; + } + + public T26 get_26() { + return _26; + } + + public T27 get_27() { + return _27; + } + + public T28 get_28() { + return _28; + } + + public T29 get_29() { + return _29; + } + + public T30 get_30() { + return _30; + } + + public T31 get_31() { + return _31; + } + + public T32 get_32() { + return _32; + } + + public T33 get_33() { + return _33; + } + + public T34 get_34() { + return _34; + } + + public T35 get_35() { + return _35; + } + + public T36 get_36() { + return _36; + } + + public T37 get_37() { + return _37; + } + + public T38 get_38() { + return _38; + } + + public T39 get_39() { + return _39; + } + + public T40 get_40() { + return _40; + } + + public Object[] toArray() { + return new Object[]{_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}; + } +} diff --git a/src/main/java/fi/solita/utils/functional/Tuple5.java b/src/main/java/fi/solita/utils/functional/Tuple5.java index 11ede16..11bccd9 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple5.java +++ b/src/main/java/fi/solita/utils/functional/Tuple5.java @@ -269,6 +269,13 @@ public Tuple40 join(Tuple35 t) { + return Tuple.of(_1, _2, _3, _4, _5, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30, t._31, t._32, t._33, t._34, t._35); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple6.java b/src/main/java/fi/solita/utils/functional/Tuple6.java index 0515755..af035e7 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple6.java +++ b/src/main/java/fi/solita/utils/functional/Tuple6.java @@ -264,6 +264,13 @@ public Tuple40 join(Tuple34 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30, t._31, t._32, t._33, t._34); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple7.java b/src/main/java/fi/solita/utils/functional/Tuple7.java index 2ca93be..1263837 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple7.java +++ b/src/main/java/fi/solita/utils/functional/Tuple7.java @@ -259,6 +259,13 @@ public Tuple40 join(Tuple33 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30, t._31, t._32, t._33); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple8.java b/src/main/java/fi/solita/utils/functional/Tuple8.java index f74eb20..2ae6226 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple8.java +++ b/src/main/java/fi/solita/utils/functional/Tuple8.java @@ -254,6 +254,13 @@ public Tuple40 join(Tuple32 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30, t._31, t._32); + } + /** * @return a prefix of this tuple. */ diff --git a/src/main/java/fi/solita/utils/functional/Tuple9.java b/src/main/java/fi/solita/utils/functional/Tuple9.java index c6f929a..2b9e4ef 100644 --- a/src/main/java/fi/solita/utils/functional/Tuple9.java +++ b/src/main/java/fi/solita/utils/functional/Tuple9.java @@ -248,6 +248,13 @@ public Tuple39 join(Tuple30 t) { return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30); } + + /** + * @return this tuple with {@code t} joined to the right. + */ + public Tuple40 join(Tuple31 t) { + return Tuple.of(_1, _2, _3, _4, _5, _6, _7, _8, _9, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8, t._9, t._10, t._11, t._12, t._13, t._14, t._15, t._16, t._17, t._18, t._19, t._20, t._21, t._22, t._23, t._24, t._25, t._26, t._27, t._28, t._29, t._30, t._31); + } /** * @return a prefix of this tuple. diff --git a/src/main/java/fi/solita/utils/functional/lens/Builder.java b/src/main/java/fi/solita/utils/functional/lens/Builder.java index 554765f..a7f4b23 100644 --- a/src/main/java/fi/solita/utils/functional/lens/Builder.java +++ b/src/main/java/fi/solita/utils/functional/lens/Builder.java @@ -52,6 +52,7 @@ import fi.solita.utils.functional.Apply38; import fi.solita.utils.functional.Apply39; import fi.solita.utils.functional.Apply4; +import fi.solita.utils.functional.Apply40; import fi.solita.utils.functional.Apply5; import fi.solita.utils.functional.Apply6; import fi.solita.utils.functional.Apply7; @@ -101,6 +102,7 @@ import fi.solita.utils.functional.Tuple38; import fi.solita.utils.functional.Tuple39; import fi.solita.utils.functional.Tuple4; +import fi.solita.utils.functional.Tuple40; import fi.solita.utils.functional.Tuple5; import fi.solita.utils.functional.Tuple6; import fi.solita.utils.functional.Tuple7; @@ -1252,4 +1254,48 @@ public static > members, Apply39 constructor) { return newBuilder(Tuple.asList(members), Function.of(constructor)); } + + public static Builder of( + Tuple40, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply, + ? extends Apply> members, Apply40 constructor) { + return newBuilder(Tuple.asList(members), Function.of(constructor)); + } } diff --git a/src/main/java/fi/solita/utils/functional/lens/Lens.java b/src/main/java/fi/solita/utils/functional/lens/Lens.java index e529e3a..3b972e0 100644 --- a/src/main/java/fi/solita/utils/functional/lens/Lens.java +++ b/src/main/java/fi/solita/utils/functional/lens/Lens.java @@ -1033,7 +1033,7 @@ public _38 apply(_38 t, Apply f) { } /** - * @return lens targetting field 38 of a tuple. + * @return lens targetting field 39 of a tuple. */ public static final Lens<_39,T> _39() { return new Lens<_39, T>(new Apply<_39, T>() { @@ -1050,4 +1050,23 @@ public _39 apply(_39 t, Apply f) { } }); } + + /** + * @return lens targetting field 40 of a tuple. + */ + public static final Lens<_40,T> _40() { + return new Lens<_40, T>(new Apply<_40, T>() { + public T apply(_40 t) { + return t.get_40(); + } + }, new Function2<_40, Apply, _40>() { + @SuppressWarnings("unchecked") + @Override + public _40 apply(_40 t, Apply f) { + Object[] vs = ((Tuple)t).toArray(); + vs[39] = f.apply(t.get_40()); + return (_40) Tuple.of(vs); + } + }); + } }