All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.ext.consul.NodeQueryOptionsConverter Maven / Gradle / Ivy

The newest version!
package io.vertx.ext.consul;

import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import java.time.Instant;
import java.time.format.DateTimeFormatter;

/**
 * Converter and mapper for {@link io.vertx.ext.consul.NodeQueryOptions}.
 * NOTE: This class has been automatically generated from the {@link io.vertx.ext.consul.NodeQueryOptions} original class using Vert.x codegen.
 */
public class NodeQueryOptionsConverter {

   static void fromJson(Iterable> json, NodeQueryOptions obj) {
    for (java.util.Map.Entry member : json) {
      switch (member.getKey()) {
        case "near":
          if (member.getValue() instanceof String) {
            obj.setNear((String)member.getValue());
          }
          break;
        case "blockingOptions":
          if (member.getValue() instanceof JsonObject) {
            obj.setBlockingOptions(new io.vertx.ext.consul.BlockingQueryOptions((io.vertx.core.json.JsonObject)member.getValue()));
          }
          break;
      }
    }
  }

   static void toJson(NodeQueryOptions obj, JsonObject json) {
    toJson(obj, json.getMap());
  }

   static void toJson(NodeQueryOptions obj, java.util.Map json) {
    if (obj.getNear() != null) {
      json.put("near", obj.getNear());
    }
    if (obj.getBlockingOptions() != null) {
      json.put("blockingOptions", obj.getBlockingOptions().toJson());
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy