package io.vertx.groovy.servicediscovery.types;
public class MessageSource_GroovyStaticExtension {
public static java.util.Map<String, Object> createRecord(io.vertx.servicediscovery.types.MessageSource j_receiver, java.lang.String name, java.lang.String address, java.lang.String type, java.util.Map<String, Object> metadata) {
return io.vertx.servicediscovery.types.MessageSource.createRecord(name,
address,
type,
metadata != null ? io.vertx.core.impl.ConversionHelper.toJsonObject(metadata) : null) != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(io.vertx.servicediscovery.types.MessageSource.createRecord(name,
address,
type,
metadata != null ? io.vertx.core.impl.ConversionHelper.toJsonObject(metadata) : null).toJson()) : null;
}
public static java.util.Map<String, Object> createRecord(io.vertx.servicediscovery.types.MessageSource j_receiver, java.lang.String name, java.lang.String address, java.lang.String type) {
return io.vertx.servicediscovery.types.MessageSource.createRecord(name,
address,
type) != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(io.vertx.servicediscovery.types.MessageSource.createRecord(name,
address,
type).toJson()) : null;
}
public static java.util.Map<String, Object> createRecord(io.vertx.servicediscovery.types.MessageSource j_receiver, java.lang.String name, java.lang.String address) {
return io.vertx.servicediscovery.types.MessageSource.createRecord(name,
address) != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(io.vertx.servicediscovery.types.MessageSource.createRecord(name,
address).toJson()) : null;
}
public static <T>void getConsumer(io.vertx.servicediscovery.types.MessageSource j_receiver, io.vertx.servicediscovery.ServiceDiscovery discovery, java.util.Map<String, Object> filter, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.eventbus.MessageConsumer<java.lang.Object>>> resultHandler) {
io.vertx.servicediscovery.types.MessageSource.getConsumer(discovery,
filter != null ? io.vertx.core.impl.ConversionHelper.toJsonObject(filter) : null,
resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.eventbus.MessageConsumer<java.lang.Object>>>() {
public void handle(io.vertx.core.AsyncResult<io.vertx.core.eventbus.MessageConsumer<java.lang.Object>> ar) {
resultHandler.handle(ar.map(event -> io.vertx.core.impl.ConversionHelper.fromObject(event)));
}
} : null);
}
public static <T>void getConsumer(io.vertx.servicediscovery.types.MessageSource j_receiver, io.vertx.servicediscovery.ServiceDiscovery discovery, java.util.function.Function<java.util.Map<String, Object>, java.lang.Boolean> filter, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.eventbus.MessageConsumer<java.lang.Object>>> resultHandler) {
io.vertx.servicediscovery.types.MessageSource.getConsumer(discovery,
filter != null ? new java.util.function.Function<io.vertx.servicediscovery.Record, java.lang.Boolean>() {
public java.lang.Boolean apply(io.vertx.servicediscovery.Record t) {
java.util.Map<String, Object> o = t != null ? io.vertx.core.impl.ConversionHelper.fromJsonObject(t.toJson()) : null;
java.lang.Boolean p = filter.apply(o);
return p;
}
} : null,
resultHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.eventbus.MessageConsumer<java.lang.Object>>>() {
public void handle(io.vertx.core.AsyncResult<io.vertx.core.eventbus.MessageConsumer<java.lang.Object>> ar) {
resultHandler.handle(ar.map(event -> io.vertx.core.impl.ConversionHelper.fromObject(event)));
}
} : null);
}
}