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

io.vertx.pgclient.PgNoticeConverter Maven / Gradle / Ivy

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

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


  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, PgNotice obj) {
    for (java.util.Map.Entry member : json) {
      switch (member.getKey()) {
        case "code":
          if (member.getValue() instanceof String) {
            obj.setCode((String)member.getValue());
          }
          break;
        case "column":
          if (member.getValue() instanceof String) {
            obj.setColumn((String)member.getValue());
          }
          break;
        case "constraint":
          if (member.getValue() instanceof String) {
            obj.setConstraint((String)member.getValue());
          }
          break;
        case "dataType":
          if (member.getValue() instanceof String) {
            obj.setDataType((String)member.getValue());
          }
          break;
        case "detail":
          if (member.getValue() instanceof String) {
            obj.setDetail((String)member.getValue());
          }
          break;
        case "file":
          if (member.getValue() instanceof String) {
            obj.setFile((String)member.getValue());
          }
          break;
        case "hint":
          if (member.getValue() instanceof String) {
            obj.setHint((String)member.getValue());
          }
          break;
        case "internalPosition":
          if (member.getValue() instanceof String) {
            obj.setInternalPosition((String)member.getValue());
          }
          break;
        case "internalQuery":
          if (member.getValue() instanceof String) {
            obj.setInternalQuery((String)member.getValue());
          }
          break;
        case "line":
          if (member.getValue() instanceof String) {
            obj.setLine((String)member.getValue());
          }
          break;
        case "message":
          if (member.getValue() instanceof String) {
            obj.setMessage((String)member.getValue());
          }
          break;
        case "position":
          if (member.getValue() instanceof String) {
            obj.setPosition((String)member.getValue());
          }
          break;
        case "routine":
          if (member.getValue() instanceof String) {
            obj.setRoutine((String)member.getValue());
          }
          break;
        case "schema":
          if (member.getValue() instanceof String) {
            obj.setSchema((String)member.getValue());
          }
          break;
        case "severity":
          if (member.getValue() instanceof String) {
            obj.setSeverity((String)member.getValue());
          }
          break;
        case "table":
          if (member.getValue() instanceof String) {
            obj.setTable((String)member.getValue());
          }
          break;
        case "where":
          if (member.getValue() instanceof String) {
            obj.setWhere((String)member.getValue());
          }
          break;
      }
    }
  }

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

  public static void toJson(PgNotice obj, java.util.Map json) {
    if (obj.getCode() != null) {
      json.put("code", obj.getCode());
    }
    if (obj.getColumn() != null) {
      json.put("column", obj.getColumn());
    }
    if (obj.getConstraint() != null) {
      json.put("constraint", obj.getConstraint());
    }
    if (obj.getDataType() != null) {
      json.put("dataType", obj.getDataType());
    }
    if (obj.getDetail() != null) {
      json.put("detail", obj.getDetail());
    }
    if (obj.getFile() != null) {
      json.put("file", obj.getFile());
    }
    if (obj.getHint() != null) {
      json.put("hint", obj.getHint());
    }
    if (obj.getInternalPosition() != null) {
      json.put("internalPosition", obj.getInternalPosition());
    }
    if (obj.getInternalQuery() != null) {
      json.put("internalQuery", obj.getInternalQuery());
    }
    if (obj.getLine() != null) {
      json.put("line", obj.getLine());
    }
    if (obj.getMessage() != null) {
      json.put("message", obj.getMessage());
    }
    if (obj.getPosition() != null) {
      json.put("position", obj.getPosition());
    }
    if (obj.getRoutine() != null) {
      json.put("routine", obj.getRoutine());
    }
    if (obj.getSchema() != null) {
      json.put("schema", obj.getSchema());
    }
    if (obj.getSeverity() != null) {
      json.put("severity", obj.getSeverity());
    }
    if (obj.getTable() != null) {
      json.put("table", obj.getTable());
    }
    if (obj.getWhere() != null) {
      json.put("where", obj.getWhere());
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy