All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.davidmoten.rx.jdbc.QueryUpdateTransformerFromObservable Maven / Gradle / Ivy

There is a newer version: 0.7.19
Show newest version
package com.github.davidmoten.rx.jdbc;

import com.github.davidmoten.rx.jdbc.QueryUpdate.Builder;

import rx.Observable;
import rx.Observable.Transformer;
import rx.functions.Func1;

/**
 * {@link Transformer} corresonding to {@link QueryUpdateOperation}.
 */
class QueryUpdateTransformerFromObservable
        implements Transformer, Observable> {

    private final Builder builder;

    /**
     * Constructor.
     * 
     * @param builder
     * @param operatorType
     */
    QueryUpdateTransformerFromObservable(final QueryUpdate.Builder builder) {
        this.builder = builder;
    }

    @Override
    public Observable> call(Observable> observable) {
        return observable.map(new Func1, Observable>() {
            @Override
            public Observable call(Observable parameters) {
                return builder.clearParameters().parameters(parameters).count();
            }
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy