http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/lang/Tuple6.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/lang/Tuple6.java b/src/main/groovy/groovy/lang/Tuple6.java index 14542d4..04258ff 100644 --- a/src/main/groovy/groovy/lang/Tuple6.java +++ b/src/main/groovy/groovy/lang/Tuple6.java @@ -19,9 +19,6 @@ package groovy.lang; -import groovy.util.function.Function1; -import groovy.util.function.Function6; - /** * Represents a list of 6 typed Objects. * @@ -105,304 +102,4 @@ public final class Tuple6<T1, T2, T3, T4, T5, T6> extends Tuple { return v6; } - - /** - * Concatenate a value to this tuple. - */ - public final <T7> Tuple7<T1, T2, T3, T4, T5, T6, T7> concat(T7 value) { - return new Tuple7<>(v1, v2, v3, v4, v5, v6, value); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final Tuple6<T1, T2, T3, T4, T5, T6> concat(Tuple0 tuple) { - return new Tuple6<>(v1, v2, v3, v4, v5, v6); - } - - - /** - * Concatenate a tuple to this tuple. - */ - public final <T7> Tuple7<T1, T2, T3, T4, T5, T6, T7> concat(Tuple1<T7> tuple) { - return new Tuple7<>(v1, v2, v3, v4, v5, v6, tuple.getV1()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T7, T8> Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> concat(Tuple2<T7, T8> tuple) { - return new Tuple8<>(v1, v2, v3, v4, v5, v6, tuple.getV1(), tuple.getV2()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T7, T8, T9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> concat(Tuple3<T7, T8, T9> tuple) { - return new Tuple9<>(v1, v2, v3, v4, v5, v6, tuple.getV1(), tuple.getV2(), tuple.getV3()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T7, T8, T9, T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> concat(Tuple4<T7, T8, T9, T10> tuple) { - return new Tuple10<>(v1, v2, v3, v4, v5, v6, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T7, T8, T9, T10, T11> Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> concat(Tuple5<T7, T8, T9, T10, T11> tuple) { - return new Tuple11<>(v1, v2, v3, v4, v5, v6, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T7, T8, T9, T10, T11, T12> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> concat(Tuple6<T7, T8, T9, T10, T11, T12> tuple) { - return new Tuple12<>(v1, v2, v3, v4, v5, v6, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T7, T8, T9, T10, T11, T12, T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> concat(Tuple7<T7, T8, T9, T10, T11, T12, T13> tuple) { - return new Tuple13<>(v1, v2, v3, v4, v5, v6, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6(), tuple.getV7()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T7, T8, T9, T10, T11, T12, T13, T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(Tuple8<T7, T8, T9, T10, T11, T12, T13, T14> tuple) { - return new Tuple14<>(v1, v2, v3, v4, v5, v6, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6(), tuple.getV7(), tuple.getV8()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T7, T8, T9, T10, T11, T12, T13, T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(Tuple9<T7, T8, T9, T10, T11, T12, T13, T14, T15> tuple) { - return new Tuple15<>(v1, v2, v3, v4, v5, v6, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6(), tuple.getV7(), tuple.getV8(), tuple.getV9()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(Tuple10<T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> tuple) { - return new Tuple16<>(v1, v2, v3, v4, v5, v6, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6(), tuple.getV7(), tuple.getV8(), tuple.getV9(), tuple.getV10()); - } - - /** - * Split this tuple into two tuples of degree 0 and 6. - */ - public final Tuple2<Tuple0, Tuple6<T1, T2, T3, T4, T5, T6>> split0() { - return new Tuple2<>(limit0(), skip0()); - } - - /** - * Split this tuple into two tuples of degree 1 and 5. - */ - public final Tuple2<Tuple1<T1>, Tuple5<T2, T3, T4, T5, T6>> split1() { - return new Tuple2<>(limit1(), skip1()); - } - - /** - * Split this tuple into two tuples of degree 2 and 4. - */ - public final Tuple2<Tuple2<T1, T2>, Tuple4<T3, T4, T5, T6>> split2() { - return new Tuple2<>(limit2(), skip2()); - } - - /** - * Split this tuple into two tuples of degree 3 and 3. - */ - public final Tuple2<Tuple3<T1, T2, T3>, Tuple3<T4, T5, T6>> split3() { - return new Tuple2<>(limit3(), skip3()); - } - - /** - * Split this tuple into two tuples of degree 4 and 2. - */ - public final Tuple2<Tuple4<T1, T2, T3, T4>, Tuple2<T5, T6>> split4() { - return new Tuple2<>(limit4(), skip4()); - } - - /** - * Split this tuple into two tuples of degree 5 and 1. - */ - public final Tuple2<Tuple5<T1, T2, T3, T4, T5>, Tuple1<T6>> split5() { - return new Tuple2<>(limit5(), skip5()); - } - - /** - * Split this tuple into two tuples of degree 6 and 0. - */ - public final Tuple2<Tuple6<T1, T2, T3, T4, T5, T6>, Tuple0> split6() { - return new Tuple2<>(limit6(), skip6()); - } - - /** - * Limit this tuple to degree 0. - */ - public final Tuple0 limit0() { - return Tuple0.INSTANCE; - } - - /** - * Limit this tuple to degree 1. - */ - public final Tuple1<T1> limit1() { - return new Tuple1<>(v1); - } - - /** - * Limit this tuple to degree 2. - */ - public final Tuple2<T1, T2> limit2() { - return new Tuple2<>(v1, v2); - } - - /** - * Limit this tuple to degree 3. - */ - public final Tuple3<T1, T2, T3> limit3() { - return new Tuple3<>(v1, v2, v3); - } - - /** - * Limit this tuple to degree 4. - */ - public final Tuple4<T1, T2, T3, T4> limit4() { - return new Tuple4<>(v1, v2, v3, v4); - } - - /** - * Limit this tuple to degree 5. - */ - public final Tuple5<T1, T2, T3, T4, T5> limit5() { - return new Tuple5<>(v1, v2, v3, v4, v5); - } - - /** - * Limit this tuple to degree 6. - */ - public final Tuple6<T1, T2, T3, T4, T5, T6> limit6() { - return this; - } - - /** - * Skip 0 degrees from this tuple. - */ - public final Tuple6<T1, T2, T3, T4, T5, T6> skip0() { - return this; - } - - /** - * Skip 1 degrees from this tuple. - */ - public final Tuple5<T2, T3, T4, T5, T6> skip1() { - return new Tuple5<>(v2, v3, v4, v5, v6); - } - - /** - * Skip 2 degrees from this tuple. - */ - public final Tuple4<T3, T4, T5, T6> skip2() { - return new Tuple4<>(v3, v4, v5, v6); - } - - /** - * Skip 3 degrees from this tuple. - */ - public final Tuple3<T4, T5, T6> skip3() { - return new Tuple3<>(v4, v5, v6); - } - - /** - * Skip 4 degrees from this tuple. - */ - public final Tuple2<T5, T6> skip4() { - return new Tuple2<>(v5, v6); - } - - /** - * Skip 5 degrees from this tuple. - */ - public final Tuple1<T6> skip5() { - return new Tuple1<>(v6); - } - - /** - * Skip 6 degrees from this tuple. - */ - public final Tuple0 skip6() { - return Tuple0.INSTANCE; - } - - /** - * Apply this tuple as arguments to a function. - */ - public final <R> R map(Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> function) { - return function.apply(v1, v2, v3, v4, v5, v6); - } - - /** - * Apply attribute 1 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U1> Tuple6<U1, T2, T3, T4, T5, T6> map1(Function1<? super T1, ? extends U1> function) { - return new Tuple6<>(function.apply(v1), v2, v3, v4, v5, v6); - } - - /** - * Apply attribute 2 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U2> Tuple6<T1, U2, T3, T4, T5, T6> map2(Function1<? super T2, ? extends U2> function) { - return new Tuple6<>(v1, function.apply(v2), v3, v4, v5, v6); - } - - /** - * Apply attribute 3 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U3> Tuple6<T1, T2, U3, T4, T5, T6> map3(Function1<? super T3, ? extends U3> function) { - return new Tuple6<>(v1, v2, function.apply(v3), v4, v5, v6); - } - - /** - * Apply attribute 4 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U4> Tuple6<T1, T2, T3, U4, T5, T6> map4(Function1<? super T4, ? extends U4> function) { - return new Tuple6<>(v1, v2, v3, function.apply(v4), v5, v6); - } - - /** - * Apply attribute 5 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U5> Tuple6<T1, T2, T3, T4, U5, T6> map5(Function1<? super T5, ? extends U5> function) { - return new Tuple6<>(v1, v2, v3, v4, function.apply(v5), v6); - } - - /** - * Apply attribute 6 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U6> Tuple6<T1, T2, T3, T4, T5, U6> map6(Function1<? super T6, ? extends U6> function) { - return new Tuple6<>(v1, v2, v3, v4, v5, function.apply(v6)); - } - - /** - * Maps the attributes of this tuple using a mapper function. - */ - public final <U1, U2, U3, U4, U5, U6> Tuple6<U1, U2, U3, U4, U5, U6> mapAll(Function6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, Tuple6<U1, U2, U3, U4, U5, U6>> function) { - return function.apply(v1, v2, v3, v4, v5, v6); - } - - /** - * Maps the attributes of this tuple using mapper functions. - */ - public final <U1, U2, U3, U4, U5, U6> Tuple6<U1, U2, U3, U4, U5, U6> mapAll(Function1<? super T1, ? extends U1> function1, Function1<? super T2, ? extends U2> function2, Function1<? super T3, ? extends U3> function3, Function1<? super T4, ? extends U4> function4, Function1<? super T5, ? extends U5> function5, Function1<? super T6, ? extends U6> function6) { - return new Tuple6<>(function1.apply(v1), function2.apply(v2), function3.apply(v3), function4.apply(v4), function5.apply(v5), function6.apply(v6)); - } - - @Override - public Tuple6<T1, T2, T3, T4, T5, T6> clone() { - return new Tuple6<>(this); - } }
http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/lang/Tuple7.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/lang/Tuple7.java b/src/main/groovy/groovy/lang/Tuple7.java index ea06599..b609c07 100644 --- a/src/main/groovy/groovy/lang/Tuple7.java +++ b/src/main/groovy/groovy/lang/Tuple7.java @@ -19,9 +19,6 @@ package groovy.lang; -import groovy.util.function.Function1; -import groovy.util.function.Function7; - /** * Represents a list of 7 typed Objects. * @@ -116,327 +113,4 @@ public final class Tuple7<T1, T2, T3, T4, T5, T6, T7> extends Tuple { return v7; } - - /** - * Concatenate a value to this tuple. - */ - public final <T8> Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> concat(T8 value) { - return new Tuple8<>(v1, v2, v3, v4, v5, v6, v7, value); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final Tuple7<T1, T2, T3, T4, T5, T6, T7> concat(Tuple0 tuple) { - return new Tuple7<>(v1, v2, v3, v4, v5, v6, v7); - } - - - /** - * Concatenate a tuple to this tuple. - */ - public final <T8> Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> concat(Tuple1<T8> tuple) { - return new Tuple8<>(v1, v2, v3, v4, v5, v6, v7, tuple.getV1()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T8, T9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> concat(Tuple2<T8, T9> tuple) { - return new Tuple9<>(v1, v2, v3, v4, v5, v6, v7, tuple.getV1(), tuple.getV2()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T8, T9, T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> concat(Tuple3<T8, T9, T10> tuple) { - return new Tuple10<>(v1, v2, v3, v4, v5, v6, v7, tuple.getV1(), tuple.getV2(), tuple.getV3()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T8, T9, T10, T11> Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> concat(Tuple4<T8, T9, T10, T11> tuple) { - return new Tuple11<>(v1, v2, v3, v4, v5, v6, v7, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T8, T9, T10, T11, T12> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> concat(Tuple5<T8, T9, T10, T11, T12> tuple) { - return new Tuple12<>(v1, v2, v3, v4, v5, v6, v7, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T8, T9, T10, T11, T12, T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> concat(Tuple6<T8, T9, T10, T11, T12, T13> tuple) { - return new Tuple13<>(v1, v2, v3, v4, v5, v6, v7, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T8, T9, T10, T11, T12, T13, T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(Tuple7<T8, T9, T10, T11, T12, T13, T14> tuple) { - return new Tuple14<>(v1, v2, v3, v4, v5, v6, v7, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6(), tuple.getV7()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T8, T9, T10, T11, T12, T13, T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(Tuple8<T8, T9, T10, T11, T12, T13, T14, T15> tuple) { - return new Tuple15<>(v1, v2, v3, v4, v5, v6, v7, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6(), tuple.getV7(), tuple.getV8()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T8, T9, T10, T11, T12, T13, T14, T15, T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(Tuple9<T8, T9, T10, T11, T12, T13, T14, T15, T16> tuple) { - return new Tuple16<>(v1, v2, v3, v4, v5, v6, v7, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6(), tuple.getV7(), tuple.getV8(), tuple.getV9()); - } - - /** - * Split this tuple into two tuples of degree 0 and 7. - */ - public final Tuple2<Tuple0, Tuple7<T1, T2, T3, T4, T5, T6, T7>> split0() { - return new Tuple2<>(limit0(), skip0()); - } - - /** - * Split this tuple into two tuples of degree 1 and 6. - */ - public final Tuple2<Tuple1<T1>, Tuple6<T2, T3, T4, T5, T6, T7>> split1() { - return new Tuple2<>(limit1(), skip1()); - } - - /** - * Split this tuple into two tuples of degree 2 and 5. - */ - public final Tuple2<Tuple2<T1, T2>, Tuple5<T3, T4, T5, T6, T7>> split2() { - return new Tuple2<>(limit2(), skip2()); - } - - /** - * Split this tuple into two tuples of degree 3 and 4. - */ - public final Tuple2<Tuple3<T1, T2, T3>, Tuple4<T4, T5, T6, T7>> split3() { - return new Tuple2<>(limit3(), skip3()); - } - - /** - * Split this tuple into two tuples of degree 4 and 3. - */ - public final Tuple2<Tuple4<T1, T2, T3, T4>, Tuple3<T5, T6, T7>> split4() { - return new Tuple2<>(limit4(), skip4()); - } - - /** - * Split this tuple into two tuples of degree 5 and 2. - */ - public final Tuple2<Tuple5<T1, T2, T3, T4, T5>, Tuple2<T6, T7>> split5() { - return new Tuple2<>(limit5(), skip5()); - } - - /** - * Split this tuple into two tuples of degree 6 and 1. - */ - public final Tuple2<Tuple6<T1, T2, T3, T4, T5, T6>, Tuple1<T7>> split6() { - return new Tuple2<>(limit6(), skip6()); - } - - /** - * Split this tuple into two tuples of degree 7 and 0. - */ - public final Tuple2<Tuple7<T1, T2, T3, T4, T5, T6, T7>, Tuple0> split7() { - return new Tuple2<>(limit7(), skip7()); - } - - /** - * Limit this tuple to degree 0. - */ - public final Tuple0 limit0() { - return Tuple0.INSTANCE; - } - - /** - * Limit this tuple to degree 1. - */ - public final Tuple1<T1> limit1() { - return new Tuple1<>(v1); - } - - /** - * Limit this tuple to degree 2. - */ - public final Tuple2<T1, T2> limit2() { - return new Tuple2<>(v1, v2); - } - - /** - * Limit this tuple to degree 3. - */ - public final Tuple3<T1, T2, T3> limit3() { - return new Tuple3<>(v1, v2, v3); - } - - /** - * Limit this tuple to degree 4. - */ - public final Tuple4<T1, T2, T3, T4> limit4() { - return new Tuple4<>(v1, v2, v3, v4); - } - - /** - * Limit this tuple to degree 5. - */ - public final Tuple5<T1, T2, T3, T4, T5> limit5() { - return new Tuple5<>(v1, v2, v3, v4, v5); - } - - /** - * Limit this tuple to degree 6. - */ - public final Tuple6<T1, T2, T3, T4, T5, T6> limit6() { - return new Tuple6<>(v1, v2, v3, v4, v5, v6); - } - - /** - * Limit this tuple to degree 7. - */ - public final Tuple7<T1, T2, T3, T4, T5, T6, T7> limit7() { - return this; - } - - /** - * Skip 0 degrees from this tuple. - */ - public final Tuple7<T1, T2, T3, T4, T5, T6, T7> skip0() { - return this; - } - - /** - * Skip 1 degrees from this tuple. - */ - public final Tuple6<T2, T3, T4, T5, T6, T7> skip1() { - return new Tuple6<>(v2, v3, v4, v5, v6, v7); - } - - /** - * Skip 2 degrees from this tuple. - */ - public final Tuple5<T3, T4, T5, T6, T7> skip2() { - return new Tuple5<>(v3, v4, v5, v6, v7); - } - - /** - * Skip 3 degrees from this tuple. - */ - public final Tuple4<T4, T5, T6, T7> skip3() { - return new Tuple4<>(v4, v5, v6, v7); - } - - /** - * Skip 4 degrees from this tuple. - */ - public final Tuple3<T5, T6, T7> skip4() { - return new Tuple3<>(v5, v6, v7); - } - - /** - * Skip 5 degrees from this tuple. - */ - public final Tuple2<T6, T7> skip5() { - return new Tuple2<>(v6, v7); - } - - /** - * Skip 6 degrees from this tuple. - */ - public final Tuple1<T7> skip6() { - return new Tuple1<>(v7); - } - - /** - * Skip 7 degrees from this tuple. - */ - public final Tuple0 skip7() { - return Tuple0.INSTANCE; - } - - /** - * Apply this tuple as arguments to a function. - */ - public final <R> R map(Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> function) { - return function.apply(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Apply attribute 1 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U1> Tuple7<U1, T2, T3, T4, T5, T6, T7> map1(Function1<? super T1, ? extends U1> function) { - return new Tuple7<>(function.apply(v1), v2, v3, v4, v5, v6, v7); - } - - /** - * Apply attribute 2 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U2> Tuple7<T1, U2, T3, T4, T5, T6, T7> map2(Function1<? super T2, ? extends U2> function) { - return new Tuple7<>(v1, function.apply(v2), v3, v4, v5, v6, v7); - } - - /** - * Apply attribute 3 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U3> Tuple7<T1, T2, U3, T4, T5, T6, T7> map3(Function1<? super T3, ? extends U3> function) { - return new Tuple7<>(v1, v2, function.apply(v3), v4, v5, v6, v7); - } - - /** - * Apply attribute 4 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U4> Tuple7<T1, T2, T3, U4, T5, T6, T7> map4(Function1<? super T4, ? extends U4> function) { - return new Tuple7<>(v1, v2, v3, function.apply(v4), v5, v6, v7); - } - - /** - * Apply attribute 5 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U5> Tuple7<T1, T2, T3, T4, U5, T6, T7> map5(Function1<? super T5, ? extends U5> function) { - return new Tuple7<>(v1, v2, v3, v4, function.apply(v5), v6, v7); - } - - /** - * Apply attribute 6 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U6> Tuple7<T1, T2, T3, T4, T5, U6, T7> map6(Function1<? super T6, ? extends U6> function) { - return new Tuple7<>(v1, v2, v3, v4, v5, function.apply(v6), v7); - } - - /** - * Apply attribute 7 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U7> Tuple7<T1, T2, T3, T4, T5, T6, U7> map7(Function1<? super T7, ? extends U7> function) { - return new Tuple7<>(v1, v2, v3, v4, v5, v6, function.apply(v7)); - } - - /** - * Maps the attributes of this tuple using a mapper function. - */ - public final <U1, U2, U3, U4, U5, U6, U7> Tuple7<U1, U2, U3, U4, U5, U6, U7> mapAll(Function7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, Tuple7<U1, U2, U3, U4, U5, U6, U7>> function) { - return function.apply(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Maps the attributes of this tuple using mapper functions. - */ - public final <U1, U2, U3, U4, U5, U6, U7> Tuple7<U1, U2, U3, U4, U5, U6, U7> mapAll(Function1<? super T1, ? extends U1> function1, Function1<? super T2, ? extends U2> function2, Function1<? super T3, ? extends U3> function3, Function1<? super T4, ? extends U4> function4, Function1<? super T5, ? extends U5> function5, Function1<? super T6, ? extends U6> function6, Function1<? super T7, ? extends U7> function7) { - return new Tuple7<>(function1.apply(v1), function2.apply(v2), function3.apply(v3), function4.apply(v4), function5.apply(v5), function6.apply(v6), function7.apply(v7)); - } - - - - @Override - public Tuple7<T1, T2, T3, T4, T5, T6, T7> clone() { - return new Tuple7<>(this); - } } http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/lang/Tuple8.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/lang/Tuple8.java b/src/main/groovy/groovy/lang/Tuple8.java index 35a148e..28caa86 100644 --- a/src/main/groovy/groovy/lang/Tuple8.java +++ b/src/main/groovy/groovy/lang/Tuple8.java @@ -19,9 +19,6 @@ package groovy.lang; -import groovy.util.function.Function1; -import groovy.util.function.Function8; - /** * Represents a list of 8 typed Objects. * @@ -127,346 +124,4 @@ public final class Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> extends Tuple { return v8; } - - /** - * Concatenate a value to this tuple. - */ - public final <T9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> concat(T9 value) { - return new Tuple9<>(v1, v2, v3, v4, v5, v6, v7, v8, value); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> concat(Tuple0 tuple) { - return new Tuple8<>(v1, v2, v3, v4, v5, v6, v7, v8); - } - - - /** - * Concatenate a tuple to this tuple. - */ - public final <T9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> concat(Tuple1<T9> tuple) { - return new Tuple9<>(v1, v2, v3, v4, v5, v6, v7, v8, tuple.getV1()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T9, T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> concat(Tuple2<T9, T10> tuple) { - return new Tuple10<>(v1, v2, v3, v4, v5, v6, v7, v8, tuple.getV1(), tuple.getV2()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T9, T10, T11> Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> concat(Tuple3<T9, T10, T11> tuple) { - return new Tuple11<>(v1, v2, v3, v4, v5, v6, v7, v8, tuple.getV1(), tuple.getV2(), tuple.getV3()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T9, T10, T11, T12> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> concat(Tuple4<T9, T10, T11, T12> tuple) { - return new Tuple12<>(v1, v2, v3, v4, v5, v6, v7, v8, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T9, T10, T11, T12, T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> concat(Tuple5<T9, T10, T11, T12, T13> tuple) { - return new Tuple13<>(v1, v2, v3, v4, v5, v6, v7, v8, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T9, T10, T11, T12, T13, T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(Tuple6<T9, T10, T11, T12, T13, T14> tuple) { - return new Tuple14<>(v1, v2, v3, v4, v5, v6, v7, v8, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T9, T10, T11, T12, T13, T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(Tuple7<T9, T10, T11, T12, T13, T14, T15> tuple) { - return new Tuple15<>(v1, v2, v3, v4, v5, v6, v7, v8, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6(), tuple.getV7()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T9, T10, T11, T12, T13, T14, T15, T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(Tuple8<T9, T10, T11, T12, T13, T14, T15, T16> tuple) { - return new Tuple16<>(v1, v2, v3, v4, v5, v6, v7, v8, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6(), tuple.getV7(), tuple.getV8()); - } - - /** - * Split this tuple into two tuples of degree 0 and 8. - */ - public final Tuple2<Tuple0, Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>> split0() { - return new Tuple2<>(limit0(), skip0()); - } - - /** - * Split this tuple into two tuples of degree 1 and 7. - */ - public final Tuple2<Tuple1<T1>, Tuple7<T2, T3, T4, T5, T6, T7, T8>> split1() { - return new Tuple2<>(limit1(), skip1()); - } - - /** - * Split this tuple into two tuples of degree 2 and 6. - */ - public final Tuple2<Tuple2<T1, T2>, Tuple6<T3, T4, T5, T6, T7, T8>> split2() { - return new Tuple2<>(limit2(), skip2()); - } - - /** - * Split this tuple into two tuples of degree 3 and 5. - */ - public final Tuple2<Tuple3<T1, T2, T3>, Tuple5<T4, T5, T6, T7, T8>> split3() { - return new Tuple2<>(limit3(), skip3()); - } - - /** - * Split this tuple into two tuples of degree 4 and 4. - */ - public final Tuple2<Tuple4<T1, T2, T3, T4>, Tuple4<T5, T6, T7, T8>> split4() { - return new Tuple2<>(limit4(), skip4()); - } - - /** - * Split this tuple into two tuples of degree 5 and 3. - */ - public final Tuple2<Tuple5<T1, T2, T3, T4, T5>, Tuple3<T6, T7, T8>> split5() { - return new Tuple2<>(limit5(), skip5()); - } - - /** - * Split this tuple into two tuples of degree 6 and 2. - */ - public final Tuple2<Tuple6<T1, T2, T3, T4, T5, T6>, Tuple2<T7, T8>> split6() { - return new Tuple2<>(limit6(), skip6()); - } - - /** - * Split this tuple into two tuples of degree 7 and 1. - */ - public final Tuple2<Tuple7<T1, T2, T3, T4, T5, T6, T7>, Tuple1<T8>> split7() { - return new Tuple2<>(limit7(), skip7()); - } - - /** - * Split this tuple into two tuples of degree 8 and 0. - */ - public final Tuple2<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>, Tuple0> split8() { - return new Tuple2<>(limit8(), skip8()); - } - - /** - * Limit this tuple to degree 0. - */ - public final Tuple0 limit0() { - return Tuple0.INSTANCE; - } - - /** - * Limit this tuple to degree 1. - */ - public final Tuple1<T1> limit1() { - return new Tuple1<>(v1); - } - - /** - * Limit this tuple to degree 2. - */ - public final Tuple2<T1, T2> limit2() { - return new Tuple2<>(v1, v2); - } - - /** - * Limit this tuple to degree 3. - */ - public final Tuple3<T1, T2, T3> limit3() { - return new Tuple3<>(v1, v2, v3); - } - - /** - * Limit this tuple to degree 4. - */ - public final Tuple4<T1, T2, T3, T4> limit4() { - return new Tuple4<>(v1, v2, v3, v4); - } - - /** - * Limit this tuple to degree 5. - */ - public final Tuple5<T1, T2, T3, T4, T5> limit5() { - return new Tuple5<>(v1, v2, v3, v4, v5); - } - - /** - * Limit this tuple to degree 6. - */ - public final Tuple6<T1, T2, T3, T4, T5, T6> limit6() { - return new Tuple6<>(v1, v2, v3, v4, v5, v6); - } - - /** - * Limit this tuple to degree 7. - */ - public final Tuple7<T1, T2, T3, T4, T5, T6, T7> limit7() { - return new Tuple7<>(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Limit this tuple to degree 8. - */ - public final Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> limit8() { - return this; - } - - /** - * Skip 0 degrees from this tuple. - */ - public final Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> skip0() { - return this; - } - - /** - * Skip 1 degrees from this tuple. - */ - public final Tuple7<T2, T3, T4, T5, T6, T7, T8> skip1() { - return new Tuple7<>(v2, v3, v4, v5, v6, v7, v8); - } - - /** - * Skip 2 degrees from this tuple. - */ - public final Tuple6<T3, T4, T5, T6, T7, T8> skip2() { - return new Tuple6<>(v3, v4, v5, v6, v7, v8); - } - - /** - * Skip 3 degrees from this tuple. - */ - public final Tuple5<T4, T5, T6, T7, T8> skip3() { - return new Tuple5<>(v4, v5, v6, v7, v8); - } - - /** - * Skip 4 degrees from this tuple. - */ - public final Tuple4<T5, T6, T7, T8> skip4() { - return new Tuple4<>(v5, v6, v7, v8); - } - - /** - * Skip 5 degrees from this tuple. - */ - public final Tuple3<T6, T7, T8> skip5() { - return new Tuple3<>(v6, v7, v8); - } - - /** - * Skip 6 degrees from this tuple. - */ - public final Tuple2<T7, T8> skip6() { - return new Tuple2<>(v7, v8); - } - - /** - * Skip 7 degrees from this tuple. - */ - public final Tuple1<T8> skip7() { - return new Tuple1<>(v8); - } - - /** - * Skip 8 degrees from this tuple. - */ - public final Tuple0 skip8() { - return Tuple0.INSTANCE; - } - - /** - * Apply this tuple as arguments to a function. - */ - public final <R> R map(Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> function) { - return function.apply(v1, v2, v3, v4, v5, v6, v7, v8); - } - - /** - * Apply attribute 1 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U1> Tuple8<U1, T2, T3, T4, T5, T6, T7, T8> map1(Function1<? super T1, ? extends U1> function) { - return new Tuple8<>(function.apply(v1), v2, v3, v4, v5, v6, v7, v8); - } - - /** - * Apply attribute 2 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U2> Tuple8<T1, U2, T3, T4, T5, T6, T7, T8> map2(Function1<? super T2, ? extends U2> function) { - return new Tuple8<>(v1, function.apply(v2), v3, v4, v5, v6, v7, v8); - } - - /** - * Apply attribute 3 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U3> Tuple8<T1, T2, U3, T4, T5, T6, T7, T8> map3(Function1<? super T3, ? extends U3> function) { - return new Tuple8<>(v1, v2, function.apply(v3), v4, v5, v6, v7, v8); - } - - /** - * Apply attribute 4 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U4> Tuple8<T1, T2, T3, U4, T5, T6, T7, T8> map4(Function1<? super T4, ? extends U4> function) { - return new Tuple8<>(v1, v2, v3, function.apply(v4), v5, v6, v7, v8); - } - - /** - * Apply attribute 5 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U5> Tuple8<T1, T2, T3, T4, U5, T6, T7, T8> map5(Function1<? super T5, ? extends U5> function) { - return new Tuple8<>(v1, v2, v3, v4, function.apply(v5), v6, v7, v8); - } - - /** - * Apply attribute 6 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U6> Tuple8<T1, T2, T3, T4, T5, U6, T7, T8> map6(Function1<? super T6, ? extends U6> function) { - return new Tuple8<>(v1, v2, v3, v4, v5, function.apply(v6), v7, v8); - } - - /** - * Apply attribute 7 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U7> Tuple8<T1, T2, T3, T4, T5, T6, U7, T8> map7(Function1<? super T7, ? extends U7> function) { - return new Tuple8<>(v1, v2, v3, v4, v5, v6, function.apply(v7), v8); - } - - /** - * Apply attribute 8 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U8> Tuple8<T1, T2, T3, T4, T5, T6, T7, U8> map8(Function1<? super T8, ? extends U8> function) { - return new Tuple8<>(v1, v2, v3, v4, v5, v6, v7, function.apply(v8)); - } - - /** - * Maps the attributes of this tuple using a mapper function. - */ - public final <U1, U2, U3, U4, U5, U6, U7, U8> Tuple8<U1, U2, U3, U4, U5, U6, U7, U8> mapAll(Function8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, Tuple8<U1, U2, U3, U4, U5, U6, U7, U8>> function) { - return function.apply(v1, v2, v3, v4, v5, v6, v7, v8); - } - - /** - * Maps the attributes of this tuple using mapper functions. - */ - public final <U1, U2, U3, U4, U5, U6, U7, U8> Tuple8<U1, U2, U3, U4, U5, U6, U7, U8> mapAll(Function1<? super T1, ? extends U1> function1, Function1<? super T2, ? extends U2> function2, Function1<? super T3, ? extends U3> function3, Function1<? super T4, ? extends U4> function4, Function1<? super T5, ? extends U5> function5, Function1<? super T6, ? extends U6> function6, Function1<? super T7, ? extends U7> function7, Function1<? super T8, ? extends U8> function8) { - return new Tuple8<>(function1.apply(v1), function2.apply(v2), function3.apply(v3), function4.apply(v4), function5.apply(v5), function6.apply(v6), function7.apply(v7), function8.apply(v8)); - } - - @Override - public Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> clone() { - return new Tuple8<>(this); - } } http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/lang/Tuple9.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/lang/Tuple9.java b/src/main/groovy/groovy/lang/Tuple9.java index 247c845..0af366c 100644 --- a/src/main/groovy/groovy/lang/Tuple9.java +++ b/src/main/groovy/groovy/lang/Tuple9.java @@ -20,9 +20,6 @@ package groovy.lang; -import groovy.util.function.Function1; -import groovy.util.function.Function9; - /** * Represents a list of 9 typed Objects. * @@ -139,367 +136,4 @@ public final class Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> extends Tuple { return v9; } - - /** - * Concatenate a value to this tuple. - */ - public final <T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> concat(T10 value) { - return new Tuple10<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, value); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> concat(Tuple0 tuple) { - return new Tuple9<>(v1, v2, v3, v4, v5, v6, v7, v8, v9); - } - - - /** - * Concatenate a tuple to this tuple. - */ - public final <T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> concat(Tuple1<T10> tuple) { - return new Tuple10<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.getV1()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T10, T11> Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> concat(Tuple2<T10, T11> tuple) { - return new Tuple11<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.getV1(), tuple.getV2()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T10, T11, T12> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> concat(Tuple3<T10, T11, T12> tuple) { - return new Tuple12<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.getV1(), tuple.getV2(), tuple.getV3()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T10, T11, T12, T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> concat(Tuple4<T10, T11, T12, T13> tuple) { - return new Tuple13<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T10, T11, T12, T13, T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(Tuple5<T10, T11, T12, T13, T14> tuple) { - return new Tuple14<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T10, T11, T12, T13, T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(Tuple6<T10, T11, T12, T13, T14, T15> tuple) { - return new Tuple15<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6()); - } - - /** - * Concatenate a tuple to this tuple. - */ - public final <T10, T11, T12, T13, T14, T15, T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(Tuple7<T10, T11, T12, T13, T14, T15, T16> tuple) { - return new Tuple16<>(v1, v2, v3, v4, v5, v6, v7, v8, v9, tuple.getV1(), tuple.getV2(), tuple.getV3(), tuple.getV4(), tuple.getV5(), tuple.getV6(), tuple.getV7()); - } - - /** - * Split this tuple into two tuples of degree 0 and 9. - */ - public final Tuple2<Tuple0, Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>> split0() { - return new Tuple2<>(limit0(), skip0()); - } - - /** - * Split this tuple into two tuples of degree 1 and 8. - */ - public final Tuple2<Tuple1<T1>, Tuple8<T2, T3, T4, T5, T6, T7, T8, T9>> split1() { - return new Tuple2<>(limit1(), skip1()); - } - - /** - * Split this tuple into two tuples of degree 2 and 7. - */ - public final Tuple2<Tuple2<T1, T2>, Tuple7<T3, T4, T5, T6, T7, T8, T9>> split2() { - return new Tuple2<>(limit2(), skip2()); - } - - /** - * Split this tuple into two tuples of degree 3 and 6. - */ - public final Tuple2<Tuple3<T1, T2, T3>, Tuple6<T4, T5, T6, T7, T8, T9>> split3() { - return new Tuple2<>(limit3(), skip3()); - } - - /** - * Split this tuple into two tuples of degree 4 and 5. - */ - public final Tuple2<Tuple4<T1, T2, T3, T4>, Tuple5<T5, T6, T7, T8, T9>> split4() { - return new Tuple2<>(limit4(), skip4()); - } - - /** - * Split this tuple into two tuples of degree 5 and 4. - */ - public final Tuple2<Tuple5<T1, T2, T3, T4, T5>, Tuple4<T6, T7, T8, T9>> split5() { - return new Tuple2<>(limit5(), skip5()); - } - - /** - * Split this tuple into two tuples of degree 6 and 3. - */ - public final Tuple2<Tuple6<T1, T2, T3, T4, T5, T6>, Tuple3<T7, T8, T9>> split6() { - return new Tuple2<>(limit6(), skip6()); - } - - /** - * Split this tuple into two tuples of degree 7 and 2. - */ - public final Tuple2<Tuple7<T1, T2, T3, T4, T5, T6, T7>, Tuple2<T8, T9>> split7() { - return new Tuple2<>(limit7(), skip7()); - } - - /** - * Split this tuple into two tuples of degree 8 and 1. - */ - public final Tuple2<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>, Tuple1<T9>> split8() { - return new Tuple2<>(limit8(), skip8()); - } - - /** - * Split this tuple into two tuples of degree 9 and 0. - */ - public final Tuple2<Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>, Tuple0> split9() { - return new Tuple2<>(limit9(), skip9()); - } - - /** - * Limit this tuple to degree 0. - */ - public final Tuple0 limit0() { - return Tuple0.INSTANCE; - } - - /** - * Limit this tuple to degree 1. - */ - public final Tuple1<T1> limit1() { - return new Tuple1<>(v1); - } - - /** - * Limit this tuple to degree 2. - */ - public final Tuple2<T1, T2> limit2() { - return new Tuple2<>(v1, v2); - } - - /** - * Limit this tuple to degree 3. - */ - public final Tuple3<T1, T2, T3> limit3() { - return new Tuple3<>(v1, v2, v3); - } - - /** - * Limit this tuple to degree 4. - */ - public final Tuple4<T1, T2, T3, T4> limit4() { - return new Tuple4<>(v1, v2, v3, v4); - } - - /** - * Limit this tuple to degree 5. - */ - public final Tuple5<T1, T2, T3, T4, T5> limit5() { - return new Tuple5<>(v1, v2, v3, v4, v5); - } - - /** - * Limit this tuple to degree 6. - */ - public final Tuple6<T1, T2, T3, T4, T5, T6> limit6() { - return new Tuple6<>(v1, v2, v3, v4, v5, v6); - } - - /** - * Limit this tuple to degree 7. - */ - public final Tuple7<T1, T2, T3, T4, T5, T6, T7> limit7() { - return new Tuple7<>(v1, v2, v3, v4, v5, v6, v7); - } - - /** - * Limit this tuple to degree 8. - */ - public final Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> limit8() { - return new Tuple8<>(v1, v2, v3, v4, v5, v6, v7, v8); - } - - /** - * Limit this tuple to degree 9. - */ - public final Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> limit9() { - return this; - } - - /** - * Skip 0 degrees from this tuple. - */ - public final Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> skip0() { - return this; - } - - /** - * Skip 1 degrees from this tuple. - */ - public final Tuple8<T2, T3, T4, T5, T6, T7, T8, T9> skip1() { - return new Tuple8<>(v2, v3, v4, v5, v6, v7, v8, v9); - } - - /** - * Skip 2 degrees from this tuple. - */ - public final Tuple7<T3, T4, T5, T6, T7, T8, T9> skip2() { - return new Tuple7<>(v3, v4, v5, v6, v7, v8, v9); - } - - /** - * Skip 3 degrees from this tuple. - */ - public final Tuple6<T4, T5, T6, T7, T8, T9> skip3() { - return new Tuple6<>(v4, v5, v6, v7, v8, v9); - } - - /** - * Skip 4 degrees from this tuple. - */ - public final Tuple5<T5, T6, T7, T8, T9> skip4() { - return new Tuple5<>(v5, v6, v7, v8, v9); - } - - /** - * Skip 5 degrees from this tuple. - */ - public final Tuple4<T6, T7, T8, T9> skip5() { - return new Tuple4<>(v6, v7, v8, v9); - } - - /** - * Skip 6 degrees from this tuple. - */ - public final Tuple3<T7, T8, T9> skip6() { - return new Tuple3<>(v7, v8, v9); - } - - /** - * Skip 7 degrees from this tuple. - */ - public final Tuple2<T8, T9> skip7() { - return new Tuple2<>(v8, v9); - } - - /** - * Skip 8 degrees from this tuple. - */ - public final Tuple1<T9> skip8() { - return new Tuple1<>(v9); - } - - /** - * Skip 9 degrees from this tuple. - */ - public final Tuple0 skip9() { - return Tuple0.INSTANCE; - } - - /** - * Apply this tuple as arguments to a function. - */ - public final <R> R map(Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R> function) { - return function.apply(v1, v2, v3, v4, v5, v6, v7, v8, v9); - } - - /** - * Apply attribute 1 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U1> Tuple9<U1, T2, T3, T4, T5, T6, T7, T8, T9> map1(Function1<? super T1, ? extends U1> function) { - return new Tuple9<>(function.apply(v1), v2, v3, v4, v5, v6, v7, v8, v9); - } - - /** - * Apply attribute 2 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U2> Tuple9<T1, U2, T3, T4, T5, T6, T7, T8, T9> map2(Function1<? super T2, ? extends U2> function) { - return new Tuple9<>(v1, function.apply(v2), v3, v4, v5, v6, v7, v8, v9); - } - - /** - * Apply attribute 3 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U3> Tuple9<T1, T2, U3, T4, T5, T6, T7, T8, T9> map3(Function1<? super T3, ? extends U3> function) { - return new Tuple9<>(v1, v2, function.apply(v3), v4, v5, v6, v7, v8, v9); - } - - /** - * Apply attribute 4 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U4> Tuple9<T1, T2, T3, U4, T5, T6, T7, T8, T9> map4(Function1<? super T4, ? extends U4> function) { - return new Tuple9<>(v1, v2, v3, function.apply(v4), v5, v6, v7, v8, v9); - } - - /** - * Apply attribute 5 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U5> Tuple9<T1, T2, T3, T4, U5, T6, T7, T8, T9> map5(Function1<? super T5, ? extends U5> function) { - return new Tuple9<>(v1, v2, v3, v4, function.apply(v5), v6, v7, v8, v9); - } - - /** - * Apply attribute 6 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U6> Tuple9<T1, T2, T3, T4, T5, U6, T7, T8, T9> map6(Function1<? super T6, ? extends U6> function) { - return new Tuple9<>(v1, v2, v3, v4, v5, function.apply(v6), v7, v8, v9); - } - - /** - * Apply attribute 7 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U7> Tuple9<T1, T2, T3, T4, T5, T6, U7, T8, T9> map7(Function1<? super T7, ? extends U7> function) { - return new Tuple9<>(v1, v2, v3, v4, v5, v6, function.apply(v7), v8, v9); - } - - /** - * Apply attribute 8 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U8> Tuple9<T1, T2, T3, T4, T5, T6, T7, U8, T9> map8(Function1<? super T8, ? extends U8> function) { - return new Tuple9<>(v1, v2, v3, v4, v5, v6, v7, function.apply(v8), v9); - } - - /** - * Apply attribute 9 as argument to a function and return a new tuple with the substituted argument. - */ - public final <U9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, U9> map9(Function1<? super T9, ? extends U9> function) { - return new Tuple9<>(v1, v2, v3, v4, v5, v6, v7, v8, function.apply(v9)); - } - - /** - * Maps the attributes of this tuple using a mapper function. - */ - public final <U1, U2, U3, U4, U5, U6, U7, U8, U9> Tuple9<U1, U2, U3, U4, U5, U6, U7, U8, U9> mapAll(Function9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, Tuple9<U1, U2, U3, U4, U5, U6, U7, U8, U9>> function) { - return function.apply(v1, v2, v3, v4, v5, v6, v7, v8, v9); - } - - /** - * Maps the attributes of this tuple using mapper functions. - */ - public final <U1, U2, U3, U4, U5, U6, U7, U8, U9> Tuple9<U1, U2, U3, U4, U5, U6, U7, U8, U9> mapAll(Function1<? super T1, ? extends U1> function1, Function1<? super T2, ? extends U2> function2, Function1<? super T3, ? extends U3> function3, Function1<? super T4, ? extends U4> function4, Function1<? super T5, ? extends U5> function5, Function1<? super T6, ? extends U6> function6, Function1<? super T7, ? extends U7> function7, Function1<? super T8, ? extends U8> function8, Function1<? super T9, ? extends U9> function9) { - return new Tuple9<>(function1.apply(v1), function2.apply(v2), function3.apply(v3), function4.apply(v4), function5.apply(v5), function6.apply(v6), function7.apply(v7), function8.apply(v8), function9.apply(v9)); - } - - @Override - public Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> clone() { - return new Tuple9<>(this); - } } http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer0.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer0.java b/src/main/groovy/groovy/util/function/Consumer0.java deleted file mode 100644 index b146e9f..0000000 --- a/src/main/groovy/groovy/util/function/Consumer0.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple0; - - -/** - * A consumer with 0 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer0 extends Runnable { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple0 args) { - accept(); - } - - /** - * Performs this operation on the given argument. - */ - void accept(); - - @Override - default void run() { - accept(); - } - - /** - * Convert this consumer to a {@link Runnable}. - */ - default Runnable toRunnable() { - return this::accept; - } - - /** - * Convert to this consumer from a {@link Runnable}. - */ - static Consumer0 from(Runnable runnable) { - return runnable::run; - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer1.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer1.java b/src/main/groovy/groovy/util/function/Consumer1.java deleted file mode 100644 index 092efa3..0000000 --- a/src/main/groovy/groovy/util/function/Consumer1.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; - -import java.util.function.Consumer; - -/** - * A consumer with 1 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer1<T1> extends Consumer<T1> { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple1<? extends T1> args) { - accept(args.getV1()); - } - - /** - * Performs this operation on the given argument. - */ - @Override - void accept(T1 v1); - - /** - * Convert this consumer to a {@link Consumer}. - */ - default Consumer<T1> toConsumer() { - return this::accept; - } - - /** - * Convert to this consumer from a {@link Consumer}. - */ - static <T1> Consumer1<T1> from(Consumer<? super T1> consumer) { - return consumer::accept; - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1) { - return () -> accept(v1); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple1<? extends T1> args) { - return () -> accept(args.getV1()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer10.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer10.java b/src/main/groovy/groovy/util/function/Consumer10.java deleted file mode 100644 index bdcd072..0000000 --- a/src/main/groovy/groovy/util/function/Consumer10.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple10; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; -import groovy.lang.Tuple5; -import groovy.lang.Tuple6; -import groovy.lang.Tuple7; -import groovy.lang.Tuple8; -import groovy.lang.Tuple9; - - -/** - * A consumer with 10 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple10<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9, ? extends T10> args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9<T2, T3, T4, T5, T6, T7, T8, T9, T10> acceptPartially(T1 v1) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8<T3, T4, T5, T6, T7, T8, T9, T10> acceptPartially(T1 v1, T2 v2) { - return (v3, v4, v5, v6, v7, v8, v9, v10) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7<T4, T5, T6, T7, T8, T9, T10> acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4, v5, v6, v7, v8, v9, v10) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6<T5, T6, T7, T8, T9, T10> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return (v5, v6, v7, v8, v9, v10) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5<T6, T7, T8, T9, T10> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { - return (v6, v7, v8, v9, v10) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4<T7, T8, T9, T10> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { - return (v7, v8, v9, v10) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3<T8, T9, T10> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { - return (v8, v9, v10) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2<T9, T10> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return (v9, v10) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1<T10> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return (v10) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return () -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9<T2, T3, T4, T5, T6, T7, T8, T9, T10> acceptPartially(Tuple1<? extends T1> args) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10) -> accept(args.getV1(), v2, v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8<T3, T4, T5, T6, T7, T8, T9, T10> acceptPartially(Tuple2<? extends T1, ? extends T2> args) { - return (v3, v4, v5, v6, v7, v8, v9, v10) -> accept(args.getV1(), args.getV2(), v3, v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7<T4, T5, T6, T7, T8, T9, T10> acceptPartially(Tuple3<? extends T1, ? extends T2, ? extends T3> args) { - return (v4, v5, v6, v7, v8, v9, v10) -> accept(args.getV1(), args.getV2(), args.getV3(), v4, v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6<T5, T6, T7, T8, T9, T10> acceptPartially(Tuple4<? extends T1, ? extends T2, ? extends T3, ? extends T4> args) { - return (v5, v6, v7, v8, v9, v10) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), v5, v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5<T6, T7, T8, T9, T10> acceptPartially(Tuple5<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5> args) { - return (v6, v7, v8, v9, v10) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), v6, v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4<T7, T8, T9, T10> acceptPartially(Tuple6<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6> args) { - return (v7, v8, v9, v10) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), v7, v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3<T8, T9, T10> acceptPartially(Tuple7<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7> args) { - return (v8, v9, v10) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), v8, v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2<T9, T10> acceptPartially(Tuple8<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8> args) { - return (v9, v10) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), v9, v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1<T10> acceptPartially(Tuple9<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9> args) { - return (v10) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), v10); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple10<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9, ? extends T10> args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer11.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer11.java b/src/main/groovy/groovy/util/function/Consumer11.java deleted file mode 100644 index 62fa1b3..0000000 --- a/src/main/groovy/groovy/util/function/Consumer11.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple10; -import groovy.lang.Tuple11; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; -import groovy.lang.Tuple5; -import groovy.lang.Tuple6; -import groovy.lang.Tuple7; -import groovy.lang.Tuple8; -import groovy.lang.Tuple9; - - -/** - * A consumer with 11 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple11<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9, ? extends T10, ? extends T11> args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> acceptPartially(T1 v1) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9<T3, T4, T5, T6, T7, T8, T9, T10, T11> acceptPartially(T1 v1, T2 v2) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8<T4, T5, T6, T7, T8, T9, T10, T11> acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4, v5, v6, v7, v8, v9, v10, v11) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7<T5, T6, T7, T8, T9, T10, T11> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return (v5, v6, v7, v8, v9, v10, v11) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6<T6, T7, T8, T9, T10, T11> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { - return (v6, v7, v8, v9, v10, v11) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5<T7, T8, T9, T10, T11> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { - return (v7, v8, v9, v10, v11) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4<T8, T9, T10, T11> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { - return (v8, v9, v10, v11) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3<T9, T10, T11> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return (v9, v10, v11) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2<T10, T11> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return (v10, v11) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1<T11> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return (v11) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { - return () -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> acceptPartially(Tuple1<? extends T1> args) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) -> accept(args.getV1(), v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9<T3, T4, T5, T6, T7, T8, T9, T10, T11> acceptPartially(Tuple2<? extends T1, ? extends T2> args) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11) -> accept(args.getV1(), args.getV2(), v3, v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8<T4, T5, T6, T7, T8, T9, T10, T11> acceptPartially(Tuple3<? extends T1, ? extends T2, ? extends T3> args) { - return (v4, v5, v6, v7, v8, v9, v10, v11) -> accept(args.getV1(), args.getV2(), args.getV3(), v4, v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7<T5, T6, T7, T8, T9, T10, T11> acceptPartially(Tuple4<? extends T1, ? extends T2, ? extends T3, ? extends T4> args) { - return (v5, v6, v7, v8, v9, v10, v11) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), v5, v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6<T6, T7, T8, T9, T10, T11> acceptPartially(Tuple5<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5> args) { - return (v6, v7, v8, v9, v10, v11) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), v6, v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5<T7, T8, T9, T10, T11> acceptPartially(Tuple6<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6> args) { - return (v7, v8, v9, v10, v11) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), v7, v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4<T8, T9, T10, T11> acceptPartially(Tuple7<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7> args) { - return (v8, v9, v10, v11) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), v8, v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3<T9, T10, T11> acceptPartially(Tuple8<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8> args) { - return (v9, v10, v11) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), v9, v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2<T10, T11> acceptPartially(Tuple9<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9> args) { - return (v10, v11) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), v10, v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1<T11> acceptPartially(Tuple10<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9, ? extends T10> args) { - return (v11) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), v11); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple11<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9, ? extends T10, ? extends T11> args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11()); - } -} http://git-wip-us.apache.org/repos/asf/groovy/blob/892f67cd/src/main/groovy/groovy/util/function/Consumer12.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/groovy/util/function/Consumer12.java b/src/main/groovy/groovy/util/function/Consumer12.java deleted file mode 100644 index 9a6112e..0000000 --- a/src/main/groovy/groovy/util/function/Consumer12.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package groovy.util.function; - -import groovy.lang.Tuple1; -import groovy.lang.Tuple10; -import groovy.lang.Tuple11; -import groovy.lang.Tuple12; -import groovy.lang.Tuple2; -import groovy.lang.Tuple3; -import groovy.lang.Tuple4; -import groovy.lang.Tuple5; -import groovy.lang.Tuple6; -import groovy.lang.Tuple7; -import groovy.lang.Tuple8; -import groovy.lang.Tuple9; - - -/** - * A consumer with 12 arguments. - * - * @since 3.0.0 - */ -@FunctionalInterface -public interface Consumer12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> { - - /** - * Performs this operation on the given argument. - * - * @param args The arguments as a tuple. - */ - default void accept(Tuple12<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9, ? extends T10, ? extends T11, ? extends T12> args) { - accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12()); - } - - /** - * Performs this operation on the given argument. - */ - void accept(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12); - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> acceptPartially(T1 v1) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> acceptPartially(T1 v1, T2 v2) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9<T4, T5, T6, T7, T8, T9, T10, T11, T12> acceptPartially(T1 v1, T2 v2, T3 v3) { - return (v4, v5, v6, v7, v8, v9, v10, v11, v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8<T5, T6, T7, T8, T9, T10, T11, T12> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4) { - return (v5, v6, v7, v8, v9, v10, v11, v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7<T6, T7, T8, T9, T10, T11, T12> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) { - return (v6, v7, v8, v9, v10, v11, v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6<T7, T8, T9, T10, T11, T12> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) { - return (v7, v8, v9, v10, v11, v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5<T8, T9, T10, T11, T12> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) { - return (v8, v9, v10, v11, v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4<T9, T10, T11, T12> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return (v9, v10, v11, v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3<T10, T11, T12> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return (v10, v11, v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2<T11, T12> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return (v11, v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1<T12> acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11) { - return (v12) -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12) { - return () -> accept(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> acceptPartially(Tuple1<? extends T1> args) { - return (v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) -> accept(args.getV1(), v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer10<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> acceptPartially(Tuple2<? extends T1, ? extends T2> args) { - return (v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) -> accept(args.getV1(), args.getV2(), v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer9<T4, T5, T6, T7, T8, T9, T10, T11, T12> acceptPartially(Tuple3<? extends T1, ? extends T2, ? extends T3> args) { - return (v4, v5, v6, v7, v8, v9, v10, v11, v12) -> accept(args.getV1(), args.getV2(), args.getV3(), v4, v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer8<T5, T6, T7, T8, T9, T10, T11, T12> acceptPartially(Tuple4<? extends T1, ? extends T2, ? extends T3, ? extends T4> args) { - return (v5, v6, v7, v8, v9, v10, v11, v12) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), v5, v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer7<T6, T7, T8, T9, T10, T11, T12> acceptPartially(Tuple5<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5> args) { - return (v6, v7, v8, v9, v10, v11, v12) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), v6, v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer6<T7, T8, T9, T10, T11, T12> acceptPartially(Tuple6<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6> args) { - return (v7, v8, v9, v10, v11, v12) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), v7, v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer5<T8, T9, T10, T11, T12> acceptPartially(Tuple7<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7> args) { - return (v8, v9, v10, v11, v12) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), v8, v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer4<T9, T10, T11, T12> acceptPartially(Tuple8<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8> args) { - return (v9, v10, v11, v12) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), v9, v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer3<T10, T11, T12> acceptPartially(Tuple9<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9> args) { - return (v10, v11, v12) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), v10, v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer2<T11, T12> acceptPartially(Tuple10<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9, ? extends T10> args) { - return (v11, v12) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), v11, v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer1<T12> acceptPartially(Tuple11<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9, ? extends T10, ? extends T11> args) { - return (v12) -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), v12); - } - - /** - * Let this consumer partially accept the arguments. - */ - default Consumer0 acceptPartially(Tuple12<? extends T1, ? extends T2, ? extends T3, ? extends T4, ? extends T5, ? extends T6, ? extends T7, ? extends T8, ? extends T9, ? extends T10, ? extends T11, ? extends T12> args) { - return () -> accept(args.getV1(), args.getV2(), args.getV3(), args.getV4(), args.getV5(), args.getV6(), args.getV7(), args.getV8(), args.getV9(), args.getV10(), args.getV11(), args.getV12()); - } -}