package io.vertx.reactivex.ext.eventbus.bridge.tcp;
import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;
import io.vertx.core.net.NetServerOptions;
import io.vertx.ext.bridge.BridgeOptions;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
@io.vertx.lang.rx.RxGen(io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge.class)
public class TcpEventBusBridge {
@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;
TcpEventBusBridge that = (TcpEventBusBridge) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final io.vertx.lang.rx.TypeArg<TcpEventBusBridge> __TYPE_ARG = new io.vertx.lang.rx.TypeArg<>( obj -> new TcpEventBusBridge((io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge) obj),
TcpEventBusBridge::getDelegate
);
private final io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge delegate;
public TcpEventBusBridge(io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge delegate) {
this.delegate = delegate;
}
public io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge getDelegate() {
return delegate;
}
public static io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge create(io.vertx.reactivex.core.Vertx vertx) {
io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge ret = io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge.newInstance(io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge.create(vertx.getDelegate()));
return ret;
}
public static io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge create(io.vertx.reactivex.core.Vertx vertx, BridgeOptions options) {
io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge ret = io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge.newInstance(io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge.create(vertx.getDelegate(), options));
return ret;
}
public static io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge create(io.vertx.reactivex.core.Vertx vertx, BridgeOptions options, NetServerOptions netServerOptions) {
io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge ret = io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge.newInstance(io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge.create(vertx.getDelegate(), options, netServerOptions));
return ret;
}
public static io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge create(io.vertx.reactivex.core.Vertx vertx, BridgeOptions options, NetServerOptions netServerOptions, Handler<io.vertx.reactivex.ext.eventbus.bridge.tcp.BridgeEvent> eventHandler) {
io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge ret = io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge.newInstance(io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge.create(vertx.getDelegate(), options, netServerOptions, new Handler<io.vertx.ext.eventbus.bridge.tcp.BridgeEvent>() {
public void handle(io.vertx.ext.eventbus.bridge.tcp.BridgeEvent event) {
eventHandler.handle(io.vertx.reactivex.ext.eventbus.bridge.tcp.BridgeEvent.newInstance(event));
}
}));
return ret;
}
public io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge listen() {
delegate.listen();
return this;
}
public io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge listen(Handler<AsyncResult<io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge>> handler) {
delegate.listen(new Handler<AsyncResult<io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge>>() {
public void handle(AsyncResult<io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge> ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge.newInstance(ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
public Single<io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge> rxListen() {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
listen(handler);
});
}
public io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge listen(int port, String address) {
delegate.listen(port, address);
return this;
}
public io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge listen(int port, String address, Handler<AsyncResult<io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge>> handler) {
delegate.listen(port, address, new Handler<AsyncResult<io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge>>() {
public void handle(AsyncResult<io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge> ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge.newInstance(ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
public Single<io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge> rxListen(int port, String address) {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
listen(port, address, handler);
});
}
public io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge listen(int port) {
delegate.listen(port);
return this;
}
public io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge listen(int port, Handler<AsyncResult<io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge>> handler) {
delegate.listen(port, new Handler<AsyncResult<io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge>>() {
public void handle(AsyncResult<io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge> ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge.newInstance(ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
public Single<io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge> rxListen(int port) {
return io.vertx.reactivex.impl.AsyncResultSingle.toSingle(handler -> {
listen(port, handler);
});
}
public void close(Handler<AsyncResult<Void>> handler) {
delegate.close(handler);
}
public Completable rxClose() {
return io.vertx.reactivex.impl.AsyncResultCompletable.toCompletable(handler -> {
close(handler);
});
}
public void close() {
delegate.close();
}
public static TcpEventBusBridge newInstance(io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge arg) {
return arg != null ? new TcpEventBusBridge(arg) : null;
}
}