package io.vertx.groovy.amqp;
public class AmqpClient_GroovyExtension {
  public static io.vertx.amqp.AmqpClient createReceiver(io.vertx.amqp.AmqpClient j_receiver, java.lang.String address, java.util.Map<String, Object> receiverOptions, io.vertx.core.Handler<io.vertx.amqp.AmqpMessage> messageHandler, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.amqp.AmqpReceiver>> completionHandler) {
    io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.createReceiver(address,
      receiverOptions != null ? new io.vertx.amqp.AmqpReceiverOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(receiverOptions)) : null,
      messageHandler != null ? event -> messageHandler.handle(io.vertx.core.impl.ConversionHelper.fromObject(event)) : null,
      completionHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.amqp.AmqpReceiver>>() {
      public void handle(io.vertx.core.AsyncResult<io.vertx.amqp.AmqpReceiver> ar) {
        completionHandler.handle(ar.map(event -> io.vertx.core.impl.ConversionHelper.fromObject(event)));
      }
    } : null));
    return j_receiver;
  }
  public static io.vertx.amqp.AmqpClient createSender(io.vertx.amqp.AmqpClient j_receiver, java.lang.String address, java.util.Map<String, Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.amqp.AmqpSender>> completionHandler) {
    io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.createSender(address,
      options != null ? new io.vertx.amqp.AmqpSenderOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null,
      completionHandler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.amqp.AmqpSender>>() {
      public void handle(io.vertx.core.AsyncResult<io.vertx.amqp.AmqpSender> ar) {
        completionHandler.handle(ar.map(event -> io.vertx.core.impl.ConversionHelper.fromObject(event)));
      }
    } : null));
    return j_receiver;
  }
}