Skip to content

Adding Func5-9 and N to the wrapper #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}