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

io.vertx.oracleclient.OracleConnectOptionsConverter Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR2
Show newest version
package io.vertx.oracleclient;

import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.impl.JsonUtil;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.util.Base64;

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


  private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
  private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

   static void fromJson(Iterable> json, OracleConnectOptions obj) {
    for (java.util.Map.Entry member : json) {
      switch (member.getKey()) {
        case "instanceName":
          if (member.getValue() instanceof String) {
            obj.setInstanceName((String)member.getValue());
          }
          break;
        case "serverMode":
          if (member.getValue() instanceof String) {
            obj.setServerMode(io.vertx.oracleclient.ServerMode.valueOf((String)member.getValue()));
          }
          break;
        case "serviceId":
          if (member.getValue() instanceof String) {
            obj.setServiceId((String)member.getValue());
          }
          break;
        case "serviceName":
          if (member.getValue() instanceof String) {
            obj.setServiceName((String)member.getValue());
          }
          break;
        case "tnsAdmin":
          if (member.getValue() instanceof String) {
            obj.setTnsAdmin((String)member.getValue());
          }
          break;
        case "tnsAlias":
          if (member.getValue() instanceof String) {
            obj.setTnsAlias((String)member.getValue());
          }
          break;
      }
    }
  }

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

   static void toJson(OracleConnectOptions obj, java.util.Map json) {
    if (obj.getInstanceName() != null) {
      json.put("instanceName", obj.getInstanceName());
    }
    if (obj.getServerMode() != null) {
      json.put("serverMode", obj.getServerMode().name());
    }
    if (obj.getServiceId() != null) {
      json.put("serviceId", obj.getServiceId());
    }
    if (obj.getServiceName() != null) {
      json.put("serviceName", obj.getServiceName());
    }
    if (obj.getTnsAdmin() != null) {
      json.put("tnsAdmin", obj.getTnsAdmin());
    }
    if (obj.getTnsAlias() != null) {
      json.put("tnsAlias", obj.getTnsAlias());
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy