package io.vertx.reactivex.ext.web.codec;
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.web.codec.BodyCodec.class)
public class BodyCodec<T> {
@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;
BodyCodec that = (BodyCodec) o;
return delegate.equals(that.delegate);
}
@Override
public int hashCode() {
return delegate.hashCode();
}
public static final TypeArg<BodyCodec> __TYPE_ARG = new TypeArg<>( obj -> new BodyCodec((io.vertx.ext.web.codec.BodyCodec) obj),
BodyCodec::getDelegate
);
private final io.vertx.ext.web.codec.BodyCodec<T> delegate;
public final TypeArg<T> __typeArg_0;
public BodyCodec(io.vertx.ext.web.codec.BodyCodec delegate) {
this.delegate = delegate;
this.__typeArg_0 = TypeArg.unknown(); }
public BodyCodec(Object delegate, TypeArg<T> typeArg_0) {
this.delegate = (io.vertx.ext.web.codec.BodyCodec)delegate;
this.__typeArg_0 = typeArg_0;
}
public io.vertx.ext.web.codec.BodyCodec getDelegate() {
return delegate;
}
private static final TypeArg<io.vertx.reactivex.core.buffer.Buffer> TYPE_ARG_0 = new TypeArg<io.vertx.reactivex.core.buffer.Buffer>(o1 -> io.vertx.reactivex.core.buffer.Buffer.newInstance((io.vertx.core.buffer.Buffer)o1), o1 -> o1.getDelegate());
public static io.vertx.reactivex.ext.web.codec.BodyCodec<String> string() {
io.vertx.reactivex.ext.web.codec.BodyCodec<String> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.string(), TypeArg.unknown());
return ret;
}
public static io.vertx.reactivex.ext.web.codec.BodyCodec<String> string(String encoding) {
io.vertx.reactivex.ext.web.codec.BodyCodec<String> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.string(encoding), TypeArg.unknown());
return ret;
}
public static io.vertx.reactivex.ext.web.codec.BodyCodec<io.vertx.reactivex.core.buffer.Buffer> buffer() {
io.vertx.reactivex.ext.web.codec.BodyCodec<io.vertx.reactivex.core.buffer.Buffer> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.buffer(), TYPE_ARG_0);
return ret;
}
public static io.vertx.reactivex.ext.web.codec.BodyCodec<JsonObject> jsonObject() {
io.vertx.reactivex.ext.web.codec.BodyCodec<JsonObject> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.jsonObject(), TypeArg.unknown());
return ret;
}
public static io.vertx.reactivex.ext.web.codec.BodyCodec<JsonArray> jsonArray() {
io.vertx.reactivex.ext.web.codec.BodyCodec<JsonArray> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.jsonArray(), TypeArg.unknown());
return ret;
}
public static <U> io.vertx.reactivex.ext.web.codec.BodyCodec<U> json(java.lang.Class<U> type) {
io.vertx.reactivex.ext.web.codec.BodyCodec<U> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.json(io.vertx.lang.reactivex.Helper.unwrap(type)), TypeArg.of(type));
return ret;
}
public static io.vertx.reactivex.ext.web.codec.BodyCodec<Void> none() {
io.vertx.reactivex.ext.web.codec.BodyCodec<Void> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.none(), TypeArg.unknown());
return ret;
}
public static <T> io.vertx.reactivex.ext.web.codec.BodyCodec<T> create(Function<io.vertx.reactivex.core.buffer.Buffer, T> decode) {
io.vertx.reactivex.ext.web.codec.BodyCodec<T> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.create(new Function<io.vertx.core.buffer.Buffer,T>() {
public T apply(io.vertx.core.buffer.Buffer arg) {
T ret = decode.apply(io.vertx.reactivex.core.buffer.Buffer.newInstance((io.vertx.core.buffer.Buffer)arg));
return ret;
}
}), TypeArg.unknown());
return ret;
}
public static io.vertx.reactivex.ext.web.codec.BodyCodec<Void> pipe(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream) {
io.vertx.reactivex.ext.web.codec.BodyCodec<Void> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.pipe(stream.getDelegate()), TypeArg.unknown());
return ret;
}
public static io.vertx.reactivex.ext.web.codec.BodyCodec<Void> pipe(io.vertx.reactivex.core.streams.WriteStream<io.vertx.reactivex.core.buffer.Buffer> stream, boolean close) {
io.vertx.reactivex.ext.web.codec.BodyCodec<Void> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.pipe(stream.getDelegate(), close), TypeArg.unknown());
return ret;
}
public static io.vertx.reactivex.ext.web.codec.BodyCodec<Void> jsonStream(io.vertx.reactivex.core.parsetools.JsonParser parser) {
io.vertx.reactivex.ext.web.codec.BodyCodec<Void> ret = io.vertx.reactivex.ext.web.codec.BodyCodec.newInstance((io.vertx.ext.web.codec.BodyCodec)io.vertx.ext.web.codec.BodyCodec.jsonStream(parser.getDelegate()), TypeArg.unknown());
return ret;
}
public static <T> BodyCodec<T> newInstance(io.vertx.ext.web.codec.BodyCodec arg) {
return arg != null ? new BodyCodec<T>(arg) : null;
}
public static <T> BodyCodec<T> newInstance(io.vertx.ext.web.codec.BodyCodec arg, TypeArg<T> __typeArg_T) {
return arg != null ? new BodyCodec<T>(arg, __typeArg_T) : null;
}
}