Skip to content

Commit

Permalink
Merge pull request ReactiveX#352 from abersnaze/groovy-wrapper
Browse files Browse the repository at this point in the history
Adding Func5-9 and N to the wrapper
  • Loading branch information
abersnaze committed Sep 6, 2013
2 parents 90bd932 + bb6c898 commit 843b8a4
Showing 1 changed file with 48 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
import rx.util.functions.Func2;
import rx.util.functions.Func3;
import rx.util.functions.Func4;
import rx.util.functions.Func5;
import rx.util.functions.Func6;
import rx.util.functions.Func7;
import rx.util.functions.Func8;
import rx.util.functions.Func9;
import rx.util.functions.FuncN;
import rx.util.functions.Function;

/**
Expand All @@ -32,11 +38,21 @@
* @param <T4>
* @param <R>
*/
public class GroovyFunctionWrapper<T1, T2, T3, T4, R> implements Func0<R>, Func1<T1, R>, Func2<T1, T2, R>, Func3<T1, T2, T3, R>, Func4<T1, T2, T3, T4, R> {
public class GroovyFunctionWrapper<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> implements
Func0<R>,
Func1<T1, R>,
Func2<T1, T2, R>,
Func3<T1, T2, T3, R>,
Func4<T1, T2, T3, T4, R>,
Func5<T1, T2, T3, T4, T5, R>,
Func6<T1, T2, T3, T4, T5, T6, R>,
Func7<T1, T2, T3, T4, T5, T6, T7, R>,
Func8<T1, T2, T3, T4, T5, T6, T7, T8, R>,
Func9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R>,
FuncN<R> {

private final Closure<R> closure;


public GroovyFunctionWrapper(Closure<R> closure) {
this.closure = closure;
}
Expand Down Expand Up @@ -65,4 +81,34 @@ public R call(T1 t1, T2 t2, T3 t3) {
public R call(T1 t1, T2 t2, T3 t3, T4 t4) {
return (R) closure.call(t1, t2, t3, t4);
}

@Override
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) {
return (R) closure.call(t1, t2, t3, t4, t5);
}

@Override
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) {
return (R) closure.call(t1, t2, t3, t4, t5, t6);
}

@Override
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) {
return (R) closure.call(t1, t2, t3, t4, t5, t6, t7);
}

@Override
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8) {
return (R) closure.call(t1, t2, t3, t4, t5, t6, t7, t8);
}

@Override
public R call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9) {
return (R) closure.call(t1, t2, t3, t4, t5, t6, t7, t8, t9);
}

@Override
public R call(Object... args) {
return (R) closure.call(args);
}
}

0 comments on commit 843b8a4

Please sign in to comment.