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

com.noenv.reactivex.wiremongo.WireMongo Maven / Gradle / Ivy

There is a newer version: 4.5.10
Show newest version
package com.noenv.reactivex.wiremongo;

import com.noenv.wiremongo.WireMongoCommands;
import com.noenv.wiremongo.mapping.Mapping;
import io.reactivex.Completable;
import io.vertx.reactivex.core.Vertx;
import io.vertx.reactivex.impl.AsyncResultCompletable;

public class WireMongo implements WireMongoCommands {

  private final com.noenv.wiremongo.WireMongo delegate;

  public WireMongo() {
    this(new com.noenv.wiremongo.WireMongo());
  }

  public WireMongo(Vertx vertx) {
    this(new com.noenv.wiremongo.WireMongo(vertx.getDelegate()));
  }

  public WireMongo(com.noenv.wiremongo.WireMongo delegate) {
    this.delegate = delegate;
  }

  public com.noenv.wiremongo.WireMongo getDelegate() {
    return delegate;
  }

  public WireMongoClient getClient() {
    return new WireMongoClient(delegate.getClient());
  }

  public Completable readFileMappings() {
    return new AsyncResultCompletable(f -> delegate.readFileMappings().onComplete(f));
  }

  public Completable readFileMappings(String path) {
    return new AsyncResultCompletable(f -> delegate.readFileMappings(path).onComplete(f));
  }

  public WireMongo clear() {
    delegate.clear();
    return this;
  }

  @Override
  public > T addMapping(T mapping) {
    return delegate.addMapping(mapping);
  }

  @Override
  public > boolean removeMapping(T mapping) {
    return delegate.removeMapping(mapping);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy