io.vertx.ext.consul.ConsulClientOptionsConverter 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.ConsulClientOptions}.
* NOTE: This class has been automatically generated from the {@link io.vertx.ext.consul.ConsulClientOptions} original class using Vert.x codegen.
*/
public class ConsulClientOptionsConverter {
static void fromJson(Iterable> json, ConsulClientOptions obj) {
for (java.util.Map.Entry member : json) {
switch (member.getKey()) {
case "aclToken":
if (member.getValue() instanceof String) {
obj.setAclToken((String)member.getValue());
}
break;
case "dc":
if (member.getValue() instanceof String) {
obj.setDc((String)member.getValue());
}
break;
case "timeout":
if (member.getValue() instanceof Number) {
obj.setTimeout(((Number)member.getValue()).longValue());
}
break;
}
}
}
static void toJson(ConsulClientOptions obj, JsonObject json) {
toJson(obj, json.getMap());
}
static void toJson(ConsulClientOptions obj, java.util.Map json) {
if (obj.getAclToken() != null) {
json.put("aclToken", obj.getAclToken());
}
if (obj.getDc() != null) {
json.put("dc", obj.getDc());
}
json.put("timeout", obj.getTimeout());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy