|
| 1 | +package io.vertx.httpproxy; |
| 2 | + |
| 3 | +import io.vertx.core.json.JsonObject; |
| 4 | +import io.vertx.core.json.JsonArray; |
| 5 | +import io.vertx.core.json.impl.JsonUtil; |
| 6 | +import java.time.Instant; |
| 7 | +import java.time.format.DateTimeFormatter; |
| 8 | +import java.util.Base64; |
| 9 | + |
| 10 | +/** |
| 11 | + * Converter and mapper for {@link io.vertx.httpproxy.ProxyOptions}. |
| 12 | + * NOTE: This class has been automatically generated from the {@link io.vertx.httpproxy.ProxyOptions} original class using Vert.x codegen. |
| 13 | + */ |
| 14 | +public class ProxyOptionsConverter { |
| 15 | + |
| 16 | + |
| 17 | + private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER; |
| 18 | + private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER; |
| 19 | + |
| 20 | + static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ProxyOptions obj) { |
| 21 | + for (java.util.Map.Entry<String, Object> member : json) { |
| 22 | + switch (member.getKey()) { |
| 23 | + case "cacheOptions": |
| 24 | + if (member.getValue() instanceof JsonObject) { |
| 25 | + obj.setCacheOptions(new io.vertx.httpproxy.cache.CacheOptions((io.vertx.core.json.JsonObject)member.getValue())); |
| 26 | + } |
| 27 | + break; |
| 28 | + case "supportWebSocket": |
| 29 | + if (member.getValue() instanceof Boolean) { |
| 30 | + obj.setSupportWebSocket((Boolean)member.getValue()); |
| 31 | + } |
| 32 | + break; |
| 33 | + } |
| 34 | + } |
| 35 | + } |
| 36 | + |
| 37 | + static void toJson(ProxyOptions obj, JsonObject json) { |
| 38 | + toJson(obj, json.getMap()); |
| 39 | + } |
| 40 | + |
| 41 | + static void toJson(ProxyOptions obj, java.util.Map<String, Object> json) { |
| 42 | + if (obj.getCacheOptions() != null) { |
| 43 | + json.put("cacheOptions", obj.getCacheOptions().toJson()); |
| 44 | + } |
| 45 | + json.put("supportWebSocket", obj.getSupportWebSocket()); |
| 46 | + } |
| 47 | +} |
0 commit comments