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

io.vertx.ext.shell.ShellServiceOptionsConverter Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR1
Show newest version
package io.vertx.ext.shell;

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.ext.shell.ShellServiceOptions}.
 * NOTE: This class has been automatically generated from the {@link io.vertx.ext.shell.ShellServiceOptions} original class using Vert.x codegen.
 */
public class ShellServiceOptionsConverter {


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

  public static void fromJson(Iterable> json, ShellServiceOptions obj) {
    for (java.util.Map.Entry member : json) {
      switch (member.getKey()) {
        case "httpOptions":
          if (member.getValue() instanceof JsonObject) {
            obj.setHttpOptions(new io.vertx.ext.shell.term.HttpTermOptions((io.vertx.core.json.JsonObject)member.getValue()));
          }
          break;
        case "sshOptions":
          if (member.getValue() instanceof JsonObject) {
            obj.setSSHOptions(new io.vertx.ext.shell.term.SSHTermOptions((io.vertx.core.json.JsonObject)member.getValue()));
          }
          break;
        case "telnetOptions":
          if (member.getValue() instanceof JsonObject) {
            obj.setTelnetOptions(new io.vertx.ext.shell.term.TelnetTermOptions((io.vertx.core.json.JsonObject)member.getValue()));
          }
          break;
      }
    }
  }

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

  public static void toJson(ShellServiceOptions obj, java.util.Map json) {
    if (obj.getHttpOptions() != null) {
      json.put("httpOptions", obj.getHttpOptions().toJson());
    }
    if (obj.getTelnetOptions() != null) {
      json.put("telnetOptions", obj.getTelnetOptions().toJson());
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy