@Test public void curry() throws Exception { Function<Integer, Consumer<Integer>> variable = RxCurryingConsumer .curry(new BiConsumer<Integer, Integer>() { @Override public void accept(Integer first, Integer second) { Assert.assertEquals(5, first + second); } }); Consumer<Integer> firstForm = variable.apply(3); firstForm.accept(2); }
public static <A, B> Function<A, Consumer<B>> curry(final BiConsumer<A, B> action) { return new Function<A, Consumer<B>>() { @Override public Consumer<B> apply(final A a) throws Exception { return new Consumer<B>() { @Override public void accept(final B b) throws Exception { action.accept(a, b); } }; } }; }
RxCurryingConsumer { public static <A, B> Function<A, Consumer<B>> curry(final BiConsumer<A, B> action) { return new Function<A, Consumer<B>>() { @Override public Consumer<B> apply(final A a) throws Exception { return new Consumer<B>() { @Override public void accept(final B b) throws Exception { action.accept(a, b); } }; } }; } }
RxCurryingConsumer { public static <A, B> Function<A, Consumer<B>> curry(final BiConsumer<A, B> action) { return new Function<A, Consumer<B>>() { @Override public Consumer<B> apply(final A a) throws Exception { return new Consumer<B>() { @Override public void accept(final B b) throws Exception { action.accept(a, b); } }; } }; } private  RxCurryingConsumer(); }
RxCurryingConsumer { public static <A, B> Function<A, Consumer<B>> curry(final BiConsumer<A, B> action) { return new Function<A, Consumer<B>>() { @Override public Consumer<B> apply(final A a) throws Exception { return new Consumer<B>() { @Override public void accept(final B b) throws Exception { action.accept(a, b); } }; } }; } private  RxCurryingConsumer(); static Function<A, Consumer<B>> curry(final BiConsumer<A, B> action); static Function<A, Function<B, Consumer<C>>> curry(final Consumer3<A, B, C> action); static Function<A, Function<B, Function<C, Consumer<D>>>> curry(
            final Consumer4<A, B, C, D> action); static Function<A, Function<B, Function<C, Function<D, Consumer<E>>>>> curry(
            final Consumer5<A, B, C, D, E> action); static Function<A, Function<B, Function<C, Function<D, Function<E, Consumer<F>>>>>> curry(
            final Consumer6<A, B, C, D, E, F> action); static Function<A, Function<B, Function<C, Function<D, Function<E, Function<F, Consumer<G>>>>>>> curry(
            final Consumer7<A, B, C, D, E, F, G> action); static Function<A, Function<B, Function<C, Function<D, Function<E, Function<F, Function<G, Consumer<H>>>>>>>> curry(
            final Consumer8<A, B, C, D, E, F, G, H> action); static Function<A, Function<B, Function<C, Function<D, Function<E, Function<F, Function<G, Function<H, Consumer<I>>>>>>>>> curry(
            final Consumer9<A, B, C, D, E, F, G, H, I> action); }
RxCurryingConsumer { public static <A, B> Function<A, Consumer<B>> curry(final BiConsumer<A, B> action) { return new Function<A, Consumer<B>>() { @Override public Consumer<B> apply(final A a) throws Exception { return new Consumer<B>() { @Override public void accept(final B b) throws Exception { action.accept(a, b); } }; } }; } private  RxCurryingConsumer(); static Function<A, Consumer<B>> curry(final BiConsumer<A, B> action); static Function<A, Function<B, Consumer<C>>> curry(final Consumer3<A, B, C> action); static Function<A, Function<B, Function<C, Consumer<D>>>> curry(
            final Consumer4<A, B, C, D> action); static Function<A, Function<B, Function<C, Function<D, Consumer<E>>>>> curry(
            final Consumer5<A, B, C, D, E> action); static Function<A, Function<B, Function<C, Function<D, Function<E, Consumer<F>>>>>> curry(
            final Consumer6<A, B, C, D, E, F> action); static Function<A, Function<B, Function<C, Function<D, Function<E, Function<F, Consumer<G>>>>>>> curry(
            final Consumer7<A, B, C, D, E, F, G> action); static Function<A, Function<B, Function<C, Function<D, Function<E, Function<F, Function<G, Consumer<H>>>>>>>> curry(
            final Consumer8<A, B, C, D, E, F, G, H> action); static Function<A, Function<B, Function<C, Function<D, Function<E, Function<F, Function<G, Function<H, Consumer<I>>>>>>>>> curry(
            final Consumer9<A, B, C, D, E, F, G, H, I> action);  }