com.github.davidmoten.rx.jdbc.QueryUpdateOperatorFromObservable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rxjava-jdbc Show documentation
Show all versions of rxjava-jdbc Show documentation
rx-java Observables for jdbc
package com.github.davidmoten.rx.jdbc;
import rx.Observable;
import rx.Observable.Operator;
import rx.Subscriber;
import rx.functions.Func1;
import com.github.davidmoten.rx.RxUtil;
/**
* {@link Operator} corresonding to {@link QueryUpdateOperation}.
*/
class QueryUpdateOperatorFromObservable implements Operator, Observable> {
private final Operator, Observable> operator;
/**
* Constructor.
*
* @param builder
* @param operatorType
*/
QueryUpdateOperatorFromObservable(final QueryUpdate.Builder builder) {
operator = RxUtil.toOperator(
new Func1>, Observable>>() {
@Override
public Observable> call(Observable> observable) {
return observable.map(new Func1, Observable>() {
@Override
public Observable call(Observable parameters) {
return builder.clearParameters().parameters(parameters).count();
}
});
}
});
}
@Override
public Subscriber super Observable> call(Subscriber super Observable> subscriber) {
return operator.call(subscriber);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy