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

io.vertx.ext.dropwizard.MatchConverter Maven / Gradle / Ivy

package io.vertx.ext.dropwizard;

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

   static void fromJson(Iterable> json, Match obj) {
    for (java.util.Map.Entry member : json) {
      switch (member.getKey()) {
        case "value":
          if (member.getValue() instanceof String) {
            obj.setValue((String)member.getValue());
          }
          break;
        case "type":
          if (member.getValue() instanceof String) {
            obj.setType(io.vertx.ext.dropwizard.MatchType.valueOf((String)member.getValue()));
          }
          break;
        case "alias":
          if (member.getValue() instanceof String) {
            obj.setAlias((String)member.getValue());
          }
          break;
      }
    }
  }

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

   static void toJson(Match obj, java.util.Map json) {
    if (obj.getValue() != null) {
      json.put("value", obj.getValue());
    }
    if (obj.getType() != null) {
      json.put("type", obj.getType().name());
    }
    if (obj.getAlias() != null) {
      json.put("alias", obj.getAlias());
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy