/** * Create a new KafkaProducer instance * @param vertx Vert.x instance to use * @param config Kafka producer configuration * @param keyType class type for the key serialization * @param valueType class type for the value serialization * @return an instance of the KafkaProducer */ public static <K, V> io.vertx.rxjava.kafka.client.producer.KafkaProducer<K, V> create(io.vertx.rxjava.core.Vertx vertx, Map<String, String> config, Class<K> keyType, Class<V> valueType) { io.vertx.rxjava.kafka.client.producer.KafkaProducer<K, V> ret = io.vertx.rxjava.kafka.client.producer.KafkaProducer.newInstance(io.vertx.kafka.client.producer.KafkaProducer.create(vertx.getDelegate(), config, io.vertx.lang.rxjava.Helper.unwrap(keyType), io.vertx.lang.rxjava.Helper.unwrap(valueType)), io.vertx.lang.rx.TypeArg.of(keyType), io.vertx.lang.rx.TypeArg.of(valueType)); return ret; }
/** * Create a new KafkaConsumer instance * @param vertx Vert.x instance to use * @param config Kafka consumer configuration * @param keyType class type for the key deserialization * @param valueType class type for the value deserialization * @return an instance of the KafkaConsumer */ public static <K, V> io.vertx.rxjava.kafka.client.consumer.KafkaConsumer<K, V> create(io.vertx.rxjava.core.Vertx vertx, Map<String, String> config, Class<K> keyType, Class<V> valueType) { io.vertx.rxjava.kafka.client.consumer.KafkaConsumer<K, V> ret = io.vertx.rxjava.kafka.client.consumer.KafkaConsumer.newInstance(io.vertx.kafka.client.consumer.KafkaConsumer.create(vertx.getDelegate(), config, io.vertx.lang.rxjava.Helper.unwrap(keyType), io.vertx.lang.rxjava.Helper.unwrap(valueType)), io.vertx.lang.rx.TypeArg.of(keyType), io.vertx.lang.rx.TypeArg.of(valueType)); return ret; }
/** * Create a new KafkaProducer instance * @param vertx Vert.x instance to use * @param config Kafka producer configuration * @param keyType class type for the key serialization * @param valueType class type for the value serialization * @return an instance of the KafkaProducer */ public static <K, V> io.vertx.rxjava.kafka.client.producer.KafkaProducer<K, V> create(io.vertx.rxjava.core.Vertx vertx, Map<String, String> config, Class<K> keyType, Class<V> valueType) { io.vertx.rxjava.kafka.client.producer.KafkaProducer<K, V> ret = io.vertx.rxjava.kafka.client.producer.KafkaProducer.newInstance(io.vertx.kafka.client.producer.KafkaProducer.create(vertx.getDelegate(), config, io.vertx.lang.rxjava.Helper.unwrap(keyType), io.vertx.lang.rxjava.Helper.unwrap(valueType)), io.vertx.lang.rx.TypeArg.of(keyType), io.vertx.lang.rx.TypeArg.of(valueType)); return ret; }
public <U> void methodWithHandlerClassTypeParameterized(Class<U> type, Handler<io.vertx.rxjava.codegen.testmodel.GenericRefedInterface<U>> handler) { delegate.methodWithHandlerClassTypeParameterized(io.vertx.lang.rxjava.Helper.unwrap(type), new Handler<io.vertx.codegen.testmodel.GenericRefedInterface<U>>() { public void handle(io.vertx.codegen.testmodel.GenericRefedInterface<U> event) { handler.handle(io.vertx.rxjava.codegen.testmodel.GenericRefedInterface.newInstance(event, io.vertx.lang.rx.TypeArg.of(type))); } }); }
public <U> void methodWithClassTypeHandlerAsyncResult(Class<U> type, Handler<AsyncResult<U>> f) { delegate.methodWithClassTypeHandlerAsyncResult(io.vertx.lang.rxjava.Helper.unwrap(type), new Handler<AsyncResult<U>>() { public void handle(AsyncResult<U> ar) { if (ar.succeeded()) { f.handle(io.vertx.core.Future.succeededFuture((U)io.vertx.lang.rx.TypeArg.of(type).wrap(ar.result()))); } else { f.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
public <U> void methodWithClassTypeFunctionParam(Class<U> type, Function<U, String> f) { delegate.methodWithClassTypeFunctionParam(io.vertx.lang.rxjava.Helper.unwrap(type), new java.util.function.Function<U,java.lang.String>() { public java.lang.String apply(U arg) { String ret = f.apply((U)io.vertx.lang.rx.TypeArg.of(type).wrap(arg)); return ret; } }); }
public <U> void methodWithClassTypeFunctionReturn(Class<U> type, Function<String, U> f) { delegate.methodWithClassTypeFunctionReturn(io.vertx.lang.rxjava.Helper.unwrap(type), new java.util.function.Function<java.lang.String,U>() { public U apply(java.lang.String arg) { U ret = f.apply(arg); return io.vertx.lang.rx.TypeArg.of(type).<U>unwrap(ret); } }); }
/** * Create and return a codec for Java objects encoded using Jackson mapper. * @param type * @return a codec for mapping POJO to Json */ public static <U> io.vertx.rxjava.ext.web.codec.BodyCodec<U> json(Class<U> type) { io.vertx.rxjava.ext.web.codec.BodyCodec<U> ret = io.vertx.rxjava.ext.web.codec.BodyCodec.newInstance(io.vertx.ext.web.codec.BodyCodec.json(io.vertx.lang.rxjava.Helper.unwrap(type)), io.vertx.lang.rx.TypeArg.of(type)); return ret; }
/** * @param type * @return the response body decoded as the specified <code>type</code> with the Jackson mapper, or <code>null</code> if a codec other than was used */ public <R> R bodyAsJson(Class<R> type) { R ret = (R)io.vertx.lang.rx.TypeArg.of(type).wrap(delegate.bodyAsJson(io.vertx.lang.rxjava.Helper.unwrap(type))); return ret; }
/** * Decodes and returns the current value as the specified <code>type</code>. * @param type the type to decode the value to * @return the decoded value */ public <T> T mapTo(Class<T> type) { T ret = (T)io.vertx.lang.rx.TypeArg.of(type).wrap(delegate.mapTo(io.vertx.lang.rxjava.Helper.unwrap(type))); return ret; }
/** * Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet. * Unlike {@link io.vertx.rxjava.servicediscovery.ServiceReference#cached}, this method return the warpped object to the desired (given) type. * @param x the type of object * @return the object, <code>null</code> if not yet retrieved */ public <X> X cachedAs(Class<X> x) { X ret = (X)io.vertx.lang.rx.TypeArg.of(x).wrap(delegate.cachedAs(io.vertx.lang.rxjava.Helper.unwrap(x))); return ret; }
/** * @param type * @return the response body decoded as the specified <code>type</code> with the Jackson mapper, or <code>null</code> if a codec other than was used */ public <R> R bodyAsJson(Class<R> type) { R ret = (R)io.vertx.lang.rx.TypeArg.of(type).wrap(delegate.bodyAsJson(io.vertx.lang.rxjava.Helper.unwrap(type))); return ret; }
/** * Gets the object to access the service. It can be a proxy, a client or whatever object. The type depends on the * service type and the server itself. This method wraps the service object into the desired type. * @param x the type of object * @return the object to access the service wrapped to the given type */ public <X> X getAs(Class<X> x) { X ret = (X)io.vertx.lang.rx.TypeArg.of(x).wrap(delegate.getAs(io.vertx.lang.rxjava.Helper.unwrap(x))); return ret; }
public <U> void methodWithFunctionParamClassTypeParameterized(Class<U> type, Function<io.vertx.rxjava.codegen.testmodel.GenericRefedInterface<U>, String> handler) { delegate.methodWithFunctionParamClassTypeParameterized(io.vertx.lang.rxjava.Helper.unwrap(type), new java.util.function.Function<io.vertx.codegen.testmodel.GenericRefedInterface<U>,java.lang.String>() { public java.lang.String apply(io.vertx.codegen.testmodel.GenericRefedInterface<U> arg) { String ret = handler.apply(io.vertx.rxjava.codegen.testmodel.GenericRefedInterface.newInstance(arg, io.vertx.lang.rx.TypeArg.of(type))); return ret; } }); }
public <U> void methodWithClassTypeHandler(Class<U> type, Handler<U> f) { delegate.methodWithClassTypeHandler(io.vertx.lang.rxjava.Helper.unwrap(type), new Handler<U>() { public void handle(U event) { f.handle((U)io.vertx.lang.rx.TypeArg.of(type).wrap(event)); } }); }
/** * Gets the object to access the service. It can be a proxy, a client or whatever object. The type depends on the * service type and the server itself. This method wraps the service object into the desired type. * @param x the type of object * @return the object to access the service wrapped to the given type */ public <X> X getAs(Class<X> x) { X ret = (X)io.vertx.lang.rx.TypeArg.of(x).wrap(delegate.getAs(io.vertx.lang.rxjava.Helper.unwrap(x))); return ret; }
public <U> void methodWithHandlerAsyncResultClassTypeParameterized(Class<U> type, Handler<AsyncResult<io.vertx.rxjava.codegen.testmodel.GenericRefedInterface<U>>> handler) { delegate.methodWithHandlerAsyncResultClassTypeParameterized(io.vertx.lang.rxjava.Helper.unwrap(type), new Handler<AsyncResult<io.vertx.codegen.testmodel.GenericRefedInterface<U>>>() { public void handle(AsyncResult<io.vertx.codegen.testmodel.GenericRefedInterface<U>> ar) { if (ar.succeeded()) { handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.codegen.testmodel.GenericRefedInterface.newInstance(ar.result(), io.vertx.lang.rx.TypeArg.of(type)))); } else { handler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
/** * Decodes and returns the current value as the specified <code>type</code>. * @param type the type to decode the value to * @return the decoded value */ public <T> T mapTo(Class<T> type) { T ret = (T)io.vertx.lang.rx.TypeArg.of(type).wrap(delegate.mapTo(io.vertx.lang.rxjava.Helper.unwrap(type))); return ret; }
/** * Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet. * Unlike {@link io.vertx.rxjava.servicediscovery.ServiceReference#cached}, this method return the warpped object to the desired (given) type. * @param x the type of object * @return the object, <code>null</code> if not yet retrieved */ public <X> X cachedAs(Class<X> x) { X ret = (X)io.vertx.lang.rx.TypeArg.of(x).wrap(delegate.cachedAs(io.vertx.lang.rxjava.Helper.unwrap(x))); return ret; }
public <T> T methodWithClassParam(Class<T> tClass) { T ret = (T)io.vertx.lang.rx.TypeArg.of(tClass).wrap(delegate.methodWithClassParam(io.vertx.lang.rxjava.Helper.unwrap(tClass))); return ret; }