package io.vertx.reactivex.ext.eventbus.bridge.tcp;
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.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 TypeArg<TcpEventBusBridge> __TYPE_ARG = new 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 TcpEventBusBridge(Object delegate) {
this.delegate = (io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge)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)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, io.vertx.ext.bridge.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)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, io.vertx.ext.bridge.BridgeOptions options, io.vertx.core.net.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)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, io.vertx.ext.bridge.BridgeOptions options, io.vertx.core.net.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)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((io.vertx.ext.eventbus.bridge.tcp.BridgeEvent)event));
}
}));
return ret;
}
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((io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge)ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
public io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge listen() {
return
listen(ar -> { });
}
public io.reactivex.Single<io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge> rxListen() {
return AsyncResultSingle.toSingle($handler -> {
listen($handler);
});
}
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((io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge)ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
public io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge listen(int port, String address) {
return
listen(port, address, ar -> { });
}
public io.reactivex.Single<io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge> rxListen(int port, String address) {
return AsyncResultSingle.toSingle($handler -> {
listen(port, address, $handler);
});
}
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((io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge)ar.result())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
public io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge listen(int port) {
return
listen(port, ar -> { });
}
public io.reactivex.Single<io.vertx.reactivex.ext.eventbus.bridge.tcp.TcpEventBusBridge> rxListen(int port) {
return AsyncResultSingle.toSingle($handler -> {
listen(port, $handler);
});
}
public void close(Handler<AsyncResult<Void>> handler) {
delegate.close(handler);
}
public void close() {
close(ar -> { });
}
public io.reactivex.Completable rxClose() {
return AsyncResultCompletable.toCompletable($handler -> {
close($handler);
});
}
public static TcpEventBusBridge newInstance(io.vertx.ext.eventbus.bridge.tcp.TcpEventBusBridge arg) {
return arg != null ? new TcpEventBusBridge(arg) : null;
}
}