package io.vertx.reactivex.ext.mongo;
import io.vertx.reactivex.RxHelper;
import io.vertx.reactivex.ObservableHelper;
import io.vertx.reactivex.FlowableHelper;
import io.vertx.reactivex.impl.AsyncResultMaybe;
import io.vertx.reactivex.impl.AsyncResultSingle;
import io.vertx.reactivex.impl.AsyncResultCompletable;
import io.vertx.reactivex.WriteStreamObserver;
import io.vertx.reactivex.WriteStreamSubscriber;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;
@RxGen(io.vertx.ext.mongo.MongoGridFsClient.class)
public class MongoGridFsClient {
@Override
public String toString() {
return delegate.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MongoGridFsClient that = (MongoGridFsClient) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final TypeArg<MongoGridFsClient> __TYPE_ARG = new TypeArg<>( obj -> new MongoGridFsClient((io.vertx.ext.mongo.MongoGridFsClient) obj),
MongoGridFsClient::getDelegate
);
private final io.vertx.ext.mongo.MongoGridFsClient delegate;
public MongoGridFsClient(io.vertx.ext.mongo.MongoGridFsClient delegate) {
this.delegate = delegate;
}
public MongoGridFsClient(Object delegate) {
this.delegate = (io.vertx.ext.mongo.MongoGridFsClient)delegate;
}
public io.vertx.ext.mongo.MongoGridFsClient getDelegate() {
return delegate;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient delete(String id, Handler<AsyncResult<Void>> resultHandler) {
delegate.delete(id, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient delete(String id) {
return
delete(id, ar -> { });
}
public io.reactivex.Completable rxDelete(String id) {
return AsyncResultCompletable.toCompletable($handler -> {
delete(id, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadByFileName(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, Handler<AsyncResult<Long>> resultHandler) {
delegate.downloadByFileName(stream.getDelegate(), fileName, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadByFileName(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName) {
return
downloadByFileName(stream, fileName, ar -> { });
}
public io.reactivex.Single<Long> rxDownloadByFileName(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName) {
return AsyncResultSingle.toSingle($handler -> {
downloadByFileName(stream, fileName, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadByFileNameWithOptions(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options, Handler<AsyncResult<Long>> resultHandler) {
delegate.downloadByFileNameWithOptions(stream.getDelegate(), fileName, options, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadByFileNameWithOptions(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options) {
return
downloadByFileNameWithOptions(stream, fileName, options, ar -> { });
}
public io.reactivex.Single<Long> rxDownloadByFileNameWithOptions(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options) {
return AsyncResultSingle.toSingle($handler -> {
downloadByFileNameWithOptions(stream, fileName, options, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadById(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream, String id, Handler<AsyncResult<Long>> resultHandler) {
delegate.downloadById(stream.getDelegate(), id, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadById(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream, String id) {
return
downloadById(stream, id, ar -> { });
}
public io.reactivex.Single<Long> rxDownloadById(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream, String id) {
return AsyncResultSingle.toSingle($handler -> {
downloadById(stream, id, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadFile(String fileName, Handler<AsyncResult<Long>> resultHandler) {
delegate.downloadFile(fileName, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadFile(String fileName) {
return
downloadFile(fileName, ar -> { });
}
public io.reactivex.Single<Long> rxDownloadFile(String fileName) {
return AsyncResultSingle.toSingle($handler -> {
downloadFile(fileName, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadFileAs(String fileName, String newFileName, Handler<AsyncResult<Long>> resultHandler) {
delegate.downloadFileAs(fileName, newFileName, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadFileAs(String fileName, String newFileName) {
return
downloadFileAs(fileName, newFileName, ar -> { });
}
public io.reactivex.Single<Long> rxDownloadFileAs(String fileName, String newFileName) {
return AsyncResultSingle.toSingle($handler -> {
downloadFileAs(fileName, newFileName, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadFileByID(String id, String fileName, Handler<AsyncResult<Long>> resultHandler) {
delegate.downloadFileByID(id, fileName, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient downloadFileByID(String id, String fileName) {
return
downloadFileByID(id, fileName, ar -> { });
}
public io.reactivex.Single<Long> rxDownloadFileByID(String id, String fileName) {
return AsyncResultSingle.toSingle($handler -> {
downloadFileByID(id, fileName, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient drop(Handler<AsyncResult<Void>> resultHandler) {
delegate.drop(resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient drop() {
return
drop(ar -> { });
}
public io.reactivex.Completable rxDrop() {
return AsyncResultCompletable.toCompletable($handler -> {
drop($handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient findAllIds(Handler<AsyncResult<List<String>>> resultHandler) {
delegate.findAllIds(resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient findAllIds() {
return
findAllIds(ar -> { });
}
public io.reactivex.Single<List<String>> rxFindAllIds() {
return AsyncResultSingle.toSingle($handler -> {
findAllIds($handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient findIds(JsonObject query, Handler<AsyncResult<List<String>>> resultHandler) {
delegate.findIds(query, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient findIds(JsonObject query) {
return
findIds(query, ar -> { });
}
public io.reactivex.Single<List<String>> rxFindIds(JsonObject query) {
return AsyncResultSingle.toSingle($handler -> {
findIds(query, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadByFileName(io.vertx.reactivex.core.streams.ReadStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, Handler<AsyncResult<String>> resultHandler) {
delegate.uploadByFileName(stream.getDelegate(), fileName, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadByFileName(io.vertx.reactivex.core.streams.ReadStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName) {
return
uploadByFileName(stream, fileName, ar -> { });
}
public io.reactivex.Single<String> rxUploadByFileName(io.vertx.reactivex.core.streams.ReadStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName) {
return AsyncResultSingle.toSingle($handler -> {
uploadByFileName(stream, fileName, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadByFileName(io.reactivex.Flowable<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, Handler<AsyncResult<String>> resultHandler) {
delegate.uploadByFileName(io.vertx.reactivex.impl.ReadStreamSubscriber.asReadStream(stream, obj -> obj.getDelegate()).resume(), fileName, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadByFileName(io.reactivex.Flowable<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName) {
return
uploadByFileName(stream, fileName, ar -> { });
}
public io.reactivex.Single<String> rxUploadByFileName(io.reactivex.Flowable<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName) {
return AsyncResultSingle.toSingle($handler -> {
uploadByFileName(stream, fileName, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadByFileNameWithOptions(io.vertx.reactivex.core.streams.ReadStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler) {
delegate.uploadByFileNameWithOptions(stream.getDelegate(), fileName, options, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadByFileNameWithOptions(io.vertx.reactivex.core.streams.ReadStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) {
return
uploadByFileNameWithOptions(stream, fileName, options, ar -> { });
}
public io.reactivex.Single<String> rxUploadByFileNameWithOptions(io.vertx.reactivex.core.streams.ReadStream<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) {
return AsyncResultSingle.toSingle($handler -> {
uploadByFileNameWithOptions(stream, fileName, options, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadByFileNameWithOptions(io.reactivex.Flowable<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler) {
delegate.uploadByFileNameWithOptions(io.vertx.reactivex.impl.ReadStreamSubscriber.asReadStream(stream, obj -> obj.getDelegate()).resume(), fileName, options, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadByFileNameWithOptions(io.reactivex.Flowable<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) {
return
uploadByFileNameWithOptions(stream, fileName, options, ar -> { });
}
public io.reactivex.Single<String> rxUploadByFileNameWithOptions(io.reactivex.Flowable<io.vertx.reactivex.core.buffer.Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) {
return AsyncResultSingle.toSingle($handler -> {
uploadByFileNameWithOptions(stream, fileName, options, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadFile(String fileName, Handler<AsyncResult<String>> resultHandler) {
delegate.uploadFile(fileName, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadFile(String fileName) {
return
uploadFile(fileName, ar -> { });
}
public io.reactivex.Single<String> rxUploadFile(String fileName) {
return AsyncResultSingle.toSingle($handler -> {
uploadFile(fileName, $handler);
});
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadFileWithOptions(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler) {
delegate.uploadFileWithOptions(fileName, options, resultHandler);
return this;
}
public io.vertx.reactivex.ext.mongo.MongoGridFsClient uploadFileWithOptions(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) {
return
uploadFileWithOptions(fileName, options, ar -> { });
}
public io.reactivex.Single<String> rxUploadFileWithOptions(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) {
return AsyncResultSingle.toSingle($handler -> {
uploadFileWithOptions(fileName, options, $handler);
});
}
public void close() {
delegate.close();
}
public static MongoGridFsClient newInstance(io.vertx.ext.mongo.MongoGridFsClient arg) {
return arg != null ? new MongoGridFsClient(arg) : null;
}
}