-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
531 additions
and
474 deletions.
There are no files selected for viewing
108 changes: 108 additions & 0 deletions
108
src/main/generated/io/vertx/core/net/ConnectOptionsConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
package io.vertx.core.net; | ||
|
||
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.core.net.ConnectOptions}. | ||
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.ConnectOptions} original class using Vert.x codegen. | ||
*/ | ||
public class ConnectOptionsConverter { | ||
|
||
|
||
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER; | ||
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER; | ||
|
||
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, ConnectOptions obj) { | ||
for (java.util.Map.Entry<String, Object> member : json) { | ||
switch (member.getKey()) { | ||
case "applicationLayerProtocols": | ||
if (member.getValue() instanceof JsonArray) { | ||
java.util.ArrayList<java.lang.String> list = new java.util.ArrayList<>(); | ||
((Iterable<Object>)member.getValue()).forEach( item -> { | ||
if (item instanceof String) | ||
list.add((String)item); | ||
}); | ||
obj.setApplicationLayerProtocols(list); | ||
} | ||
break; | ||
case "host": | ||
if (member.getValue() instanceof String) { | ||
obj.setHost((String)member.getValue()); | ||
} | ||
break; | ||
case "hostnameVerificationAlgorithm": | ||
if (member.getValue() instanceof String) { | ||
obj.setHostnameVerificationAlgorithm((String)member.getValue()); | ||
} | ||
break; | ||
case "port": | ||
if (member.getValue() instanceof Number) { | ||
obj.setPort(((Number)member.getValue()).intValue()); | ||
} | ||
break; | ||
case "proxyOptions": | ||
if (member.getValue() instanceof JsonObject) { | ||
obj.setProxyOptions(new io.vertx.core.net.ProxyOptions((io.vertx.core.json.JsonObject)member.getValue())); | ||
} | ||
break; | ||
case "sniServerName": | ||
if (member.getValue() instanceof String) { | ||
obj.setSniServerName((String)member.getValue()); | ||
} | ||
break; | ||
case "ssl": | ||
if (member.getValue() instanceof Boolean) { | ||
obj.setSsl((Boolean)member.getValue()); | ||
} | ||
break; | ||
case "sslOptions": | ||
if (member.getValue() instanceof JsonObject) { | ||
obj.setSslOptions(new io.vertx.core.net.SSLOptions((io.vertx.core.json.JsonObject)member.getValue())); | ||
} | ||
break; | ||
case "trustAll": | ||
if (member.getValue() instanceof Boolean) { | ||
obj.setTrustAll((Boolean)member.getValue()); | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
|
||
static void toJson(ConnectOptions obj, JsonObject json) { | ||
toJson(obj, json.getMap()); | ||
} | ||
|
||
static void toJson(ConnectOptions obj, java.util.Map<String, Object> json) { | ||
if (obj.getApplicationLayerProtocols() != null) { | ||
JsonArray array = new JsonArray(); | ||
obj.getApplicationLayerProtocols().forEach(item -> array.add(item)); | ||
json.put("applicationLayerProtocols", array); | ||
} | ||
if (obj.getHost() != null) { | ||
json.put("host", obj.getHost()); | ||
} | ||
if (obj.getHostnameVerificationAlgorithm() != null) { | ||
json.put("hostnameVerificationAlgorithm", obj.getHostnameVerificationAlgorithm()); | ||
} | ||
if (obj.getPort() != null) { | ||
json.put("port", obj.getPort()); | ||
} | ||
if (obj.getProxyOptions() != null) { | ||
json.put("proxyOptions", obj.getProxyOptions().toJson()); | ||
} | ||
if (obj.getSniServerName() != null) { | ||
json.put("sniServerName", obj.getSniServerName()); | ||
} | ||
json.put("ssl", obj.isSsl()); | ||
if (obj.getSslOptions() != null) { | ||
json.put("sslOptions", obj.getSslOptions().toJson()); | ||
} | ||
json.put("trustAll", obj.isTrustAll()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.