Bring back the generated files under VCS

This commit is contained in:
Julien Ponge
2017-12-15 16:43:55 +01:00
parent 588ffbf813
commit 09646bd084
26 changed files with 2146 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.DeploymentOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.DeploymentOptions} original class using Vert.x codegen.
*/
class DeploymentOptionsConverter {
static void fromJson(JsonObject json, DeploymentOptions obj) {
if (json.getValue("config") instanceof JsonObject) {
obj.setConfig(((JsonObject)json.getValue("config")).copy());
}
if (json.getValue("extraClasspath") instanceof JsonArray) {
java.util.ArrayList<java.lang.String> list = new java.util.ArrayList<>();
json.getJsonArray("extraClasspath").forEach( item -> {
if (item instanceof String)
list.add((String)item);
});
obj.setExtraClasspath(list);
}
if (json.getValue("ha") instanceof Boolean) {
obj.setHa((Boolean)json.getValue("ha"));
}
if (json.getValue("instances") instanceof Number) {
obj.setInstances(((Number)json.getValue("instances")).intValue());
}
if (json.getValue("isolatedClasses") instanceof JsonArray) {
java.util.ArrayList<java.lang.String> list = new java.util.ArrayList<>();
json.getJsonArray("isolatedClasses").forEach( item -> {
if (item instanceof String)
list.add((String)item);
});
obj.setIsolatedClasses(list);
}
if (json.getValue("isolationGroup") instanceof String) {
obj.setIsolationGroup((String)json.getValue("isolationGroup"));
}
if (json.getValue("maxWorkerExecuteTime") instanceof Number) {
obj.setMaxWorkerExecuteTime(((Number)json.getValue("maxWorkerExecuteTime")).longValue());
}
if (json.getValue("multiThreaded") instanceof Boolean) {
obj.setMultiThreaded((Boolean)json.getValue("multiThreaded"));
}
if (json.getValue("worker") instanceof Boolean) {
obj.setWorker((Boolean)json.getValue("worker"));
}
if (json.getValue("workerPoolName") instanceof String) {
obj.setWorkerPoolName((String)json.getValue("workerPoolName"));
}
if (json.getValue("workerPoolSize") instanceof Number) {
obj.setWorkerPoolSize(((Number)json.getValue("workerPoolSize")).intValue());
}
}
static void toJson(DeploymentOptions obj, JsonObject json) {
if (obj.getConfig() != null) {
json.put("config", obj.getConfig());
}
if (obj.getExtraClasspath() != null) {
JsonArray array = new JsonArray();
obj.getExtraClasspath().forEach(item -> array.add(item));
json.put("extraClasspath", array);
}
json.put("ha", obj.isHa());
json.put("instances", obj.getInstances());
if (obj.getIsolatedClasses() != null) {
JsonArray array = new JsonArray();
obj.getIsolatedClasses().forEach(item -> array.add(item));
json.put("isolatedClasses", array);
}
if (obj.getIsolationGroup() != null) {
json.put("isolationGroup", obj.getIsolationGroup());
}
json.put("maxWorkerExecuteTime", obj.getMaxWorkerExecuteTime());
json.put("multiThreaded", obj.isMultiThreaded());
json.put("worker", obj.isWorker());
if (obj.getWorkerPoolName() != null) {
json.put("workerPoolName", obj.getWorkerPoolName());
}
json.put("workerPoolSize", obj.getWorkerPoolSize());
}
}

View File

@@ -0,0 +1,134 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.VertxOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.VertxOptions} original class using Vert.x codegen.
*/
class VertxOptionsConverter {
static void fromJson(JsonObject json, VertxOptions obj) {
if (json.getValue("addressResolverOptions") instanceof JsonObject) {
obj.setAddressResolverOptions(new io.vertx.core.dns.AddressResolverOptions((JsonObject)json.getValue("addressResolverOptions")));
}
if (json.getValue("blockedThreadCheckInterval") instanceof Number) {
obj.setBlockedThreadCheckInterval(((Number)json.getValue("blockedThreadCheckInterval")).longValue());
}
if (json.getValue("clusterHost") instanceof String) {
obj.setClusterHost((String)json.getValue("clusterHost"));
}
if (json.getValue("clusterPingInterval") instanceof Number) {
obj.setClusterPingInterval(((Number)json.getValue("clusterPingInterval")).longValue());
}
if (json.getValue("clusterPingReplyInterval") instanceof Number) {
obj.setClusterPingReplyInterval(((Number)json.getValue("clusterPingReplyInterval")).longValue());
}
if (json.getValue("clusterPort") instanceof Number) {
obj.setClusterPort(((Number)json.getValue("clusterPort")).intValue());
}
if (json.getValue("clusterPublicHost") instanceof String) {
obj.setClusterPublicHost((String)json.getValue("clusterPublicHost"));
}
if (json.getValue("clusterPublicPort") instanceof Number) {
obj.setClusterPublicPort(((Number)json.getValue("clusterPublicPort")).intValue());
}
if (json.getValue("clustered") instanceof Boolean) {
obj.setClustered((Boolean)json.getValue("clustered"));
}
if (json.getValue("eventBusOptions") instanceof JsonObject) {
obj.setEventBusOptions(new io.vertx.core.eventbus.EventBusOptions((JsonObject)json.getValue("eventBusOptions")));
}
if (json.getValue("eventLoopPoolSize") instanceof Number) {
obj.setEventLoopPoolSize(((Number)json.getValue("eventLoopPoolSize")).intValue());
}
if (json.getValue("fileResolverCachingEnabled") instanceof Boolean) {
obj.setFileResolverCachingEnabled((Boolean)json.getValue("fileResolverCachingEnabled"));
}
if (json.getValue("haEnabled") instanceof Boolean) {
obj.setHAEnabled((Boolean)json.getValue("haEnabled"));
}
if (json.getValue("haGroup") instanceof String) {
obj.setHAGroup((String)json.getValue("haGroup"));
}
if (json.getValue("internalBlockingPoolSize") instanceof Number) {
obj.setInternalBlockingPoolSize(((Number)json.getValue("internalBlockingPoolSize")).intValue());
}
if (json.getValue("maxEventLoopExecuteTime") instanceof Number) {
obj.setMaxEventLoopExecuteTime(((Number)json.getValue("maxEventLoopExecuteTime")).longValue());
}
if (json.getValue("maxWorkerExecuteTime") instanceof Number) {
obj.setMaxWorkerExecuteTime(((Number)json.getValue("maxWorkerExecuteTime")).longValue());
}
if (json.getValue("metricsOptions") instanceof JsonObject) {
obj.setMetricsOptions(new io.vertx.core.metrics.MetricsOptions((JsonObject)json.getValue("metricsOptions")));
}
if (json.getValue("preferNativeTransport") instanceof Boolean) {
obj.setPreferNativeTransport((Boolean)json.getValue("preferNativeTransport"));
}
if (json.getValue("quorumSize") instanceof Number) {
obj.setQuorumSize(((Number)json.getValue("quorumSize")).intValue());
}
if (json.getValue("warningExceptionTime") instanceof Number) {
obj.setWarningExceptionTime(((Number)json.getValue("warningExceptionTime")).longValue());
}
if (json.getValue("workerPoolSize") instanceof Number) {
obj.setWorkerPoolSize(((Number)json.getValue("workerPoolSize")).intValue());
}
}
static void toJson(VertxOptions obj, JsonObject json) {
if (obj.getAddressResolverOptions() != null) {
json.put("addressResolverOptions", obj.getAddressResolverOptions().toJson());
}
json.put("blockedThreadCheckInterval", obj.getBlockedThreadCheckInterval());
if (obj.getClusterHost() != null) {
json.put("clusterHost", obj.getClusterHost());
}
json.put("clusterPingInterval", obj.getClusterPingInterval());
json.put("clusterPingReplyInterval", obj.getClusterPingReplyInterval());
json.put("clusterPort", obj.getClusterPort());
if (obj.getClusterPublicHost() != null) {
json.put("clusterPublicHost", obj.getClusterPublicHost());
}
json.put("clusterPublicPort", obj.getClusterPublicPort());
json.put("clustered", obj.isClustered());
if (obj.getEventBusOptions() != null) {
json.put("eventBusOptions", obj.getEventBusOptions().toJson());
}
json.put("eventLoopPoolSize", obj.getEventLoopPoolSize());
json.put("fileResolverCachingEnabled", obj.isFileResolverCachingEnabled());
json.put("haEnabled", obj.isHAEnabled());
if (obj.getHAGroup() != null) {
json.put("haGroup", obj.getHAGroup());
}
json.put("internalBlockingPoolSize", obj.getInternalBlockingPoolSize());
json.put("maxEventLoopExecuteTime", obj.getMaxEventLoopExecuteTime());
json.put("maxWorkerExecuteTime", obj.getMaxWorkerExecuteTime());
if (obj.getMetricsOptions() != null) {
json.put("metricsOptions", obj.getMetricsOptions().toJson());
}
json.put("preferNativeTransport", obj.getPreferNativeTransport());
json.put("quorumSize", obj.getQuorumSize());
json.put("warningExceptionTime", obj.getWarningExceptionTime());
json.put("workerPoolSize", obj.getWorkerPoolSize());
}
}

View File

@@ -0,0 +1,68 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.cli;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.cli.Argument}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.cli.Argument} original class using Vert.x codegen.
*/
class ArgumentConverter {
static void fromJson(JsonObject json, Argument obj) {
if (json.getValue("argName") instanceof String) {
obj.setArgName((String)json.getValue("argName"));
}
if (json.getValue("defaultValue") instanceof String) {
obj.setDefaultValue((String)json.getValue("defaultValue"));
}
if (json.getValue("description") instanceof String) {
obj.setDescription((String)json.getValue("description"));
}
if (json.getValue("hidden") instanceof Boolean) {
obj.setHidden((Boolean)json.getValue("hidden"));
}
if (json.getValue("index") instanceof Number) {
obj.setIndex(((Number)json.getValue("index")).intValue());
}
if (json.getValue("multiValued") instanceof Boolean) {
obj.setMultiValued((Boolean)json.getValue("multiValued"));
}
if (json.getValue("required") instanceof Boolean) {
obj.setRequired((Boolean)json.getValue("required"));
}
}
static void toJson(Argument obj, JsonObject json) {
if (obj.getArgName() != null) {
json.put("argName", obj.getArgName());
}
if (obj.getDefaultValue() != null) {
json.put("defaultValue", obj.getDefaultValue());
}
if (obj.getDescription() != null) {
json.put("description", obj.getDescription());
}
json.put("hidden", obj.isHidden());
json.put("index", obj.getIndex());
json.put("multiValued", obj.isMultiValued());
json.put("required", obj.isRequired());
}
}

View File

@@ -0,0 +1,102 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.cli;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.cli.Option}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.cli.Option} original class using Vert.x codegen.
*/
class OptionConverter {
static void fromJson(JsonObject json, Option obj) {
if (json.getValue("argName") instanceof String) {
obj.setArgName((String)json.getValue("argName"));
}
if (json.getValue("choices") instanceof JsonArray) {
json.getJsonArray("choices").forEach(item -> {
if (item instanceof String)
obj.addChoice((String)item);
});
}
if (json.getValue("defaultValue") instanceof String) {
obj.setDefaultValue((String)json.getValue("defaultValue"));
}
if (json.getValue("description") instanceof String) {
obj.setDescription((String)json.getValue("description"));
}
if (json.getValue("flag") instanceof Boolean) {
obj.setFlag((Boolean)json.getValue("flag"));
}
if (json.getValue("help") instanceof Boolean) {
obj.setHelp((Boolean)json.getValue("help"));
}
if (json.getValue("hidden") instanceof Boolean) {
obj.setHidden((Boolean)json.getValue("hidden"));
}
if (json.getValue("longName") instanceof String) {
obj.setLongName((String)json.getValue("longName"));
}
if (json.getValue("multiValued") instanceof Boolean) {
obj.setMultiValued((Boolean)json.getValue("multiValued"));
}
if (json.getValue("required") instanceof Boolean) {
obj.setRequired((Boolean)json.getValue("required"));
}
if (json.getValue("shortName") instanceof String) {
obj.setShortName((String)json.getValue("shortName"));
}
if (json.getValue("singleValued") instanceof Boolean) {
obj.setSingleValued((Boolean)json.getValue("singleValued"));
}
}
static void toJson(Option obj, JsonObject json) {
if (obj.getArgName() != null) {
json.put("argName", obj.getArgName());
}
if (obj.getChoices() != null) {
JsonArray array = new JsonArray();
obj.getChoices().forEach(item -> array.add(item));
json.put("choices", array);
}
if (obj.getDefaultValue() != null) {
json.put("defaultValue", obj.getDefaultValue());
}
if (obj.getDescription() != null) {
json.put("description", obj.getDescription());
}
json.put("flag", obj.isFlag());
json.put("help", obj.isHelp());
json.put("hidden", obj.isHidden());
if (obj.getLongName() != null) {
json.put("longName", obj.getLongName());
}
json.put("multiValued", obj.isMultiValued());
if (obj.getName() != null) {
json.put("name", obj.getName());
}
json.put("required", obj.isRequired());
if (obj.getShortName() != null) {
json.put("shortName", obj.getShortName());
}
json.put("singleValued", obj.isSingleValued());
}
}

View File

@@ -0,0 +1,56 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.datagram;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.datagram.DatagramSocketOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.datagram.DatagramSocketOptions} original class using Vert.x codegen.
*/
class DatagramSocketOptionsConverter {
static void fromJson(JsonObject json, DatagramSocketOptions obj) {
if (json.getValue("broadcast") instanceof Boolean) {
obj.setBroadcast((Boolean)json.getValue("broadcast"));
}
if (json.getValue("ipV6") instanceof Boolean) {
obj.setIpV6((Boolean)json.getValue("ipV6"));
}
if (json.getValue("loopbackModeDisabled") instanceof Boolean) {
obj.setLoopbackModeDisabled((Boolean)json.getValue("loopbackModeDisabled"));
}
if (json.getValue("multicastNetworkInterface") instanceof String) {
obj.setMulticastNetworkInterface((String)json.getValue("multicastNetworkInterface"));
}
if (json.getValue("multicastTimeToLive") instanceof Number) {
obj.setMulticastTimeToLive(((Number)json.getValue("multicastTimeToLive")).intValue());
}
}
static void toJson(DatagramSocketOptions obj, JsonObject json) {
json.put("broadcast", obj.isBroadcast());
json.put("ipV6", obj.isIpV6());
json.put("loopbackModeDisabled", obj.isLoopbackModeDisabled());
if (obj.getMulticastNetworkInterface() != null) {
json.put("multicastNetworkInterface", obj.getMulticastNetworkInterface());
}
json.put("multicastTimeToLive", obj.getMulticastTimeToLive());
}
}

View File

@@ -0,0 +1,104 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.dns;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.dns.AddressResolverOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.dns.AddressResolverOptions} original class using Vert.x codegen.
*/
class AddressResolverOptionsConverter {
static void fromJson(JsonObject json, AddressResolverOptions obj) {
if (json.getValue("cacheMaxTimeToLive") instanceof Number) {
obj.setCacheMaxTimeToLive(((Number)json.getValue("cacheMaxTimeToLive")).intValue());
}
if (json.getValue("cacheMinTimeToLive") instanceof Number) {
obj.setCacheMinTimeToLive(((Number)json.getValue("cacheMinTimeToLive")).intValue());
}
if (json.getValue("cacheNegativeTimeToLive") instanceof Number) {
obj.setCacheNegativeTimeToLive(((Number)json.getValue("cacheNegativeTimeToLive")).intValue());
}
if (json.getValue("hostsPath") instanceof String) {
obj.setHostsPath((String)json.getValue("hostsPath"));
}
if (json.getValue("hostsValue") instanceof String) {
obj.setHostsValue(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)json.getValue("hostsValue"))));
}
if (json.getValue("maxQueries") instanceof Number) {
obj.setMaxQueries(((Number)json.getValue("maxQueries")).intValue());
}
if (json.getValue("ndots") instanceof Number) {
obj.setNdots(((Number)json.getValue("ndots")).intValue());
}
if (json.getValue("optResourceEnabled") instanceof Boolean) {
obj.setOptResourceEnabled((Boolean)json.getValue("optResourceEnabled"));
}
if (json.getValue("queryTimeout") instanceof Number) {
obj.setQueryTimeout(((Number)json.getValue("queryTimeout")).longValue());
}
if (json.getValue("rdFlag") instanceof Boolean) {
obj.setRdFlag((Boolean)json.getValue("rdFlag"));
}
if (json.getValue("rotateServers") instanceof Boolean) {
obj.setRotateServers((Boolean)json.getValue("rotateServers"));
}
if (json.getValue("searchDomains") instanceof JsonArray) {
json.getJsonArray("searchDomains").forEach(item -> {
if (item instanceof String)
obj.addSearchDomain((String)item);
});
}
if (json.getValue("servers") instanceof JsonArray) {
json.getJsonArray("servers").forEach(item -> {
if (item instanceof String)
obj.addServer((String)item);
});
}
}
static void toJson(AddressResolverOptions obj, JsonObject json) {
json.put("cacheMaxTimeToLive", obj.getCacheMaxTimeToLive());
json.put("cacheMinTimeToLive", obj.getCacheMinTimeToLive());
json.put("cacheNegativeTimeToLive", obj.getCacheNegativeTimeToLive());
if (obj.getHostsPath() != null) {
json.put("hostsPath", obj.getHostsPath());
}
if (obj.getHostsValue() != null) {
json.put("hostsValue", obj.getHostsValue().getBytes());
}
json.put("maxQueries", obj.getMaxQueries());
json.put("ndots", obj.getNdots());
json.put("optResourceEnabled", obj.isOptResourceEnabled());
json.put("queryTimeout", obj.getQueryTimeout());
json.put("rdFlag", obj.getRdFlag());
json.put("rotateServers", obj.isRotateServers());
if (obj.getSearchDomains() != null) {
JsonArray array = new JsonArray();
obj.getSearchDomains().forEach(item -> array.add(item));
json.put("searchDomains", array);
}
if (obj.getServers() != null) {
JsonArray array = new JsonArray();
obj.getServers().forEach(item -> array.add(item));
json.put("servers", array);
}
}
}

View File

@@ -0,0 +1,48 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.dns;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.dns.DnsClientOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.dns.DnsClientOptions} original class using Vert.x codegen.
*/
public class DnsClientOptionsConverter {
public static void fromJson(JsonObject json, DnsClientOptions obj) {
if (json.getValue("host") instanceof String) {
obj.setHost((String)json.getValue("host"));
}
if (json.getValue("port") instanceof Number) {
obj.setPort(((Number)json.getValue("port")).intValue());
}
if (json.getValue("queryTimeout") instanceof Number) {
obj.setQueryTimeout(((Number)json.getValue("queryTimeout")).longValue());
}
}
public static void toJson(DnsClientOptions obj, JsonObject json) {
if (obj.getHost() != null) {
json.put("host", obj.getHost());
}
json.put("port", obj.getPort());
json.put("queryTimeout", obj.getQueryTimeout());
}
}

View File

@@ -0,0 +1,248 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.eventbus;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.eventbus.EventBusOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.eventbus.EventBusOptions} original class using Vert.x codegen.
*/
class EventBusOptionsConverter {
static void fromJson(JsonObject json, EventBusOptions obj) {
if (json.getValue("acceptBacklog") instanceof Number) {
obj.setAcceptBacklog(((Number)json.getValue("acceptBacklog")).intValue());
}
if (json.getValue("clientAuth") instanceof String) {
obj.setClientAuth(io.vertx.core.http.ClientAuth.valueOf((String)json.getValue("clientAuth")));
}
if (json.getValue("clusterPingInterval") instanceof Number) {
obj.setClusterPingInterval(((Number)json.getValue("clusterPingInterval")).longValue());
}
if (json.getValue("clusterPingReplyInterval") instanceof Number) {
obj.setClusterPingReplyInterval(((Number)json.getValue("clusterPingReplyInterval")).longValue());
}
if (json.getValue("clusterPublicHost") instanceof String) {
obj.setClusterPublicHost((String)json.getValue("clusterPublicHost"));
}
if (json.getValue("clusterPublicPort") instanceof Number) {
obj.setClusterPublicPort(((Number)json.getValue("clusterPublicPort")).intValue());
}
if (json.getValue("clustered") instanceof Boolean) {
obj.setClustered((Boolean)json.getValue("clustered"));
}
if (json.getValue("connectTimeout") instanceof Number) {
obj.setConnectTimeout(((Number)json.getValue("connectTimeout")).intValue());
}
if (json.getValue("crlPaths") instanceof JsonArray) {
json.getJsonArray("crlPaths").forEach(item -> {
if (item instanceof String)
obj.addCrlPath((String)item);
});
}
if (json.getValue("crlValues") instanceof JsonArray) {
json.getJsonArray("crlValues").forEach(item -> {
if (item instanceof String)
obj.addCrlValue(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)item)));
});
}
if (json.getValue("enabledCipherSuites") instanceof JsonArray) {
json.getJsonArray("enabledCipherSuites").forEach(item -> {
if (item instanceof String)
obj.addEnabledCipherSuite((String)item);
});
}
if (json.getValue("enabledSecureTransportProtocols") instanceof JsonArray) {
json.getJsonArray("enabledSecureTransportProtocols").forEach(item -> {
if (item instanceof String)
obj.addEnabledSecureTransportProtocol((String)item);
});
}
if (json.getValue("host") instanceof String) {
obj.setHost((String)json.getValue("host"));
}
if (json.getValue("idleTimeout") instanceof Number) {
obj.setIdleTimeout(((Number)json.getValue("idleTimeout")).intValue());
}
if (json.getValue("jdkSslEngineOptions") instanceof JsonObject) {
obj.setJdkSslEngineOptions(new io.vertx.core.net.JdkSSLEngineOptions((JsonObject)json.getValue("jdkSslEngineOptions")));
}
if (json.getValue("keyStoreOptions") instanceof JsonObject) {
obj.setKeyStoreOptions(new io.vertx.core.net.JksOptions((JsonObject)json.getValue("keyStoreOptions")));
}
if (json.getValue("logActivity") instanceof Boolean) {
obj.setLogActivity((Boolean)json.getValue("logActivity"));
}
if (json.getValue("openSslEngineOptions") instanceof JsonObject) {
obj.setOpenSslEngineOptions(new io.vertx.core.net.OpenSSLEngineOptions((JsonObject)json.getValue("openSslEngineOptions")));
}
if (json.getValue("pemKeyCertOptions") instanceof JsonObject) {
obj.setPemKeyCertOptions(new io.vertx.core.net.PemKeyCertOptions((JsonObject)json.getValue("pemKeyCertOptions")));
}
if (json.getValue("pemTrustOptions") instanceof JsonObject) {
obj.setPemTrustOptions(new io.vertx.core.net.PemTrustOptions((JsonObject)json.getValue("pemTrustOptions")));
}
if (json.getValue("pfxKeyCertOptions") instanceof JsonObject) {
obj.setPfxKeyCertOptions(new io.vertx.core.net.PfxOptions((JsonObject)json.getValue("pfxKeyCertOptions")));
}
if (json.getValue("pfxTrustOptions") instanceof JsonObject) {
obj.setPfxTrustOptions(new io.vertx.core.net.PfxOptions((JsonObject)json.getValue("pfxTrustOptions")));
}
if (json.getValue("port") instanceof Number) {
obj.setPort(((Number)json.getValue("port")).intValue());
}
if (json.getValue("receiveBufferSize") instanceof Number) {
obj.setReceiveBufferSize(((Number)json.getValue("receiveBufferSize")).intValue());
}
if (json.getValue("reconnectAttempts") instanceof Number) {
obj.setReconnectAttempts(((Number)json.getValue("reconnectAttempts")).intValue());
}
if (json.getValue("reconnectInterval") instanceof Number) {
obj.setReconnectInterval(((Number)json.getValue("reconnectInterval")).longValue());
}
if (json.getValue("reuseAddress") instanceof Boolean) {
obj.setReuseAddress((Boolean)json.getValue("reuseAddress"));
}
if (json.getValue("reusePort") instanceof Boolean) {
obj.setReusePort((Boolean)json.getValue("reusePort"));
}
if (json.getValue("sendBufferSize") instanceof Number) {
obj.setSendBufferSize(((Number)json.getValue("sendBufferSize")).intValue());
}
if (json.getValue("soLinger") instanceof Number) {
obj.setSoLinger(((Number)json.getValue("soLinger")).intValue());
}
if (json.getValue("ssl") instanceof Boolean) {
obj.setSsl((Boolean)json.getValue("ssl"));
}
if (json.getValue("tcpCork") instanceof Boolean) {
obj.setTcpCork((Boolean)json.getValue("tcpCork"));
}
if (json.getValue("tcpFastOpen") instanceof Boolean) {
obj.setTcpFastOpen((Boolean)json.getValue("tcpFastOpen"));
}
if (json.getValue("tcpKeepAlive") instanceof Boolean) {
obj.setTcpKeepAlive((Boolean)json.getValue("tcpKeepAlive"));
}
if (json.getValue("tcpNoDelay") instanceof Boolean) {
obj.setTcpNoDelay((Boolean)json.getValue("tcpNoDelay"));
}
if (json.getValue("tcpQuickAck") instanceof Boolean) {
obj.setTcpQuickAck((Boolean)json.getValue("tcpQuickAck"));
}
if (json.getValue("trafficClass") instanceof Number) {
obj.setTrafficClass(((Number)json.getValue("trafficClass")).intValue());
}
if (json.getValue("trustAll") instanceof Boolean) {
obj.setTrustAll((Boolean)json.getValue("trustAll"));
}
if (json.getValue("trustStoreOptions") instanceof JsonObject) {
obj.setTrustStoreOptions(new io.vertx.core.net.JksOptions((JsonObject)json.getValue("trustStoreOptions")));
}
if (json.getValue("useAlpn") instanceof Boolean) {
obj.setUseAlpn((Boolean)json.getValue("useAlpn"));
}
if (json.getValue("usePooledBuffers") instanceof Boolean) {
obj.setUsePooledBuffers((Boolean)json.getValue("usePooledBuffers"));
}
}
static void toJson(EventBusOptions obj, JsonObject json) {
json.put("acceptBacklog", obj.getAcceptBacklog());
if (obj.getClientAuth() != null) {
json.put("clientAuth", obj.getClientAuth().name());
}
json.put("clusterPingInterval", obj.getClusterPingInterval());
json.put("clusterPingReplyInterval", obj.getClusterPingReplyInterval());
if (obj.getClusterPublicHost() != null) {
json.put("clusterPublicHost", obj.getClusterPublicHost());
}
json.put("clusterPublicPort", obj.getClusterPublicPort());
json.put("clustered", obj.isClustered());
json.put("connectTimeout", obj.getConnectTimeout());
if (obj.getCrlPaths() != null) {
JsonArray array = new JsonArray();
obj.getCrlPaths().forEach(item -> array.add(item));
json.put("crlPaths", array);
}
if (obj.getCrlValues() != null) {
JsonArray array = new JsonArray();
obj.getCrlValues().forEach(item -> array.add(item.getBytes()));
json.put("crlValues", array);
}
if (obj.getEnabledCipherSuites() != null) {
JsonArray array = new JsonArray();
obj.getEnabledCipherSuites().forEach(item -> array.add(item));
json.put("enabledCipherSuites", array);
}
if (obj.getEnabledSecureTransportProtocols() != null) {
JsonArray array = new JsonArray();
obj.getEnabledSecureTransportProtocols().forEach(item -> array.add(item));
json.put("enabledSecureTransportProtocols", array);
}
if (obj.getHost() != null) {
json.put("host", obj.getHost());
}
json.put("idleTimeout", obj.getIdleTimeout());
if (obj.getJdkSslEngineOptions() != null) {
json.put("jdkSslEngineOptions", obj.getJdkSslEngineOptions().toJson());
}
if (obj.getKeyStoreOptions() != null) {
json.put("keyStoreOptions", obj.getKeyStoreOptions().toJson());
}
json.put("logActivity", obj.getLogActivity());
if (obj.getOpenSslEngineOptions() != null) {
json.put("openSslEngineOptions", obj.getOpenSslEngineOptions().toJson());
}
if (obj.getPemKeyCertOptions() != null) {
json.put("pemKeyCertOptions", obj.getPemKeyCertOptions().toJson());
}
if (obj.getPemTrustOptions() != null) {
json.put("pemTrustOptions", obj.getPemTrustOptions().toJson());
}
if (obj.getPfxKeyCertOptions() != null) {
json.put("pfxKeyCertOptions", obj.getPfxKeyCertOptions().toJson());
}
if (obj.getPfxTrustOptions() != null) {
json.put("pfxTrustOptions", obj.getPfxTrustOptions().toJson());
}
json.put("port", obj.getPort());
json.put("receiveBufferSize", obj.getReceiveBufferSize());
json.put("reconnectAttempts", obj.getReconnectAttempts());
json.put("reconnectInterval", obj.getReconnectInterval());
json.put("reuseAddress", obj.isReuseAddress());
json.put("reusePort", obj.isReusePort());
json.put("sendBufferSize", obj.getSendBufferSize());
json.put("soLinger", obj.getSoLinger());
json.put("ssl", obj.isSsl());
json.put("tcpCork", obj.isTcpCork());
json.put("tcpFastOpen", obj.isTcpFastOpen());
json.put("tcpKeepAlive", obj.isTcpKeepAlive());
json.put("tcpNoDelay", obj.isTcpNoDelay());
json.put("tcpQuickAck", obj.isTcpQuickAck());
json.put("trafficClass", obj.getTrafficClass());
json.put("trustAll", obj.isTrustAll());
if (obj.getTrustStoreOptions() != null) {
json.put("trustStoreOptions", obj.getTrustStoreOptions().toJson());
}
json.put("useAlpn", obj.isUseAlpn());
json.put("usePooledBuffers", obj.isUsePooledBuffers());
}
}

View File

@@ -0,0 +1,50 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.file;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.file.CopyOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.file.CopyOptions} original class using Vert.x codegen.
*/
class CopyOptionsConverter {
static void fromJson(JsonObject json, CopyOptions obj) {
if (json.getValue("atomicMove") instanceof Boolean) {
obj.setAtomicMove((Boolean)json.getValue("atomicMove"));
}
if (json.getValue("copyAttributes") instanceof Boolean) {
obj.setCopyAttributes((Boolean)json.getValue("copyAttributes"));
}
if (json.getValue("nofollowLinks") instanceof Boolean) {
obj.setNofollowLinks((Boolean)json.getValue("nofollowLinks"));
}
if (json.getValue("replaceExisting") instanceof Boolean) {
obj.setReplaceExisting((Boolean)json.getValue("replaceExisting"));
}
}
static void toJson(CopyOptions obj, JsonObject json) {
json.put("atomicMove", obj.isAtomicMove());
json.put("copyAttributes", obj.isCopyAttributes());
json.put("nofollowLinks", obj.isNofollowLinks());
json.put("replaceExisting", obj.isReplaceExisting());
}
}

View File

@@ -0,0 +1,80 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.file;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.file.OpenOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.file.OpenOptions} original class using Vert.x codegen.
*/
class OpenOptionsConverter {
static void fromJson(JsonObject json, OpenOptions obj) {
if (json.getValue("append") instanceof Boolean) {
obj.setAppend((Boolean)json.getValue("append"));
}
if (json.getValue("create") instanceof Boolean) {
obj.setCreate((Boolean)json.getValue("create"));
}
if (json.getValue("createNew") instanceof Boolean) {
obj.setCreateNew((Boolean)json.getValue("createNew"));
}
if (json.getValue("deleteOnClose") instanceof Boolean) {
obj.setDeleteOnClose((Boolean)json.getValue("deleteOnClose"));
}
if (json.getValue("dsync") instanceof Boolean) {
obj.setDsync((Boolean)json.getValue("dsync"));
}
if (json.getValue("perms") instanceof String) {
obj.setPerms((String)json.getValue("perms"));
}
if (json.getValue("read") instanceof Boolean) {
obj.setRead((Boolean)json.getValue("read"));
}
if (json.getValue("sparse") instanceof Boolean) {
obj.setSparse((Boolean)json.getValue("sparse"));
}
if (json.getValue("sync") instanceof Boolean) {
obj.setSync((Boolean)json.getValue("sync"));
}
if (json.getValue("truncateExisting") instanceof Boolean) {
obj.setTruncateExisting((Boolean)json.getValue("truncateExisting"));
}
if (json.getValue("write") instanceof Boolean) {
obj.setWrite((Boolean)json.getValue("write"));
}
}
static void toJson(OpenOptions obj, JsonObject json) {
json.put("append", obj.isAppend());
json.put("create", obj.isCreate());
json.put("createNew", obj.isCreateNew());
json.put("deleteOnClose", obj.isDeleteOnClose());
json.put("dsync", obj.isDsync());
if (obj.getPerms() != null) {
json.put("perms", obj.getPerms());
}
json.put("read", obj.isRead());
json.put("sparse", obj.isSparse());
json.put("sync", obj.isSync());
json.put("truncateExisting", obj.isTruncateExisting());
json.put("write", obj.isWrite());
}
}

View File

@@ -0,0 +1,48 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.http;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.http.GoAway}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.http.GoAway} original class using Vert.x codegen.
*/
class GoAwayConverter {
static void fromJson(JsonObject json, GoAway obj) {
if (json.getValue("debugData") instanceof String) {
obj.setDebugData(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)json.getValue("debugData"))));
}
if (json.getValue("errorCode") instanceof Number) {
obj.setErrorCode(((Number)json.getValue("errorCode")).longValue());
}
if (json.getValue("lastStreamId") instanceof Number) {
obj.setLastStreamId(((Number)json.getValue("lastStreamId")).intValue());
}
}
static void toJson(GoAway obj, JsonObject json) {
if (obj.getDebugData() != null) {
json.put("debugData", obj.getDebugData().getBytes());
}
json.put("errorCode", obj.getErrorCode());
json.put("lastStreamId", obj.getLastStreamId());
}
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.http;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.http.Http2Settings}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.http.Http2Settings} original class using Vert.x codegen.
*/
class Http2SettingsConverter {
static void fromJson(JsonObject json, Http2Settings obj) {
if (json.getValue("headerTableSize") instanceof Number) {
obj.setHeaderTableSize(((Number)json.getValue("headerTableSize")).longValue());
}
if (json.getValue("initialWindowSize") instanceof Number) {
obj.setInitialWindowSize(((Number)json.getValue("initialWindowSize")).intValue());
}
if (json.getValue("maxConcurrentStreams") instanceof Number) {
obj.setMaxConcurrentStreams(((Number)json.getValue("maxConcurrentStreams")).longValue());
}
if (json.getValue("maxFrameSize") instanceof Number) {
obj.setMaxFrameSize(((Number)json.getValue("maxFrameSize")).intValue());
}
if (json.getValue("maxHeaderListSize") instanceof Number) {
obj.setMaxHeaderListSize(((Number)json.getValue("maxHeaderListSize")).longValue());
}
if (json.getValue("pushEnabled") instanceof Boolean) {
obj.setPushEnabled((Boolean)json.getValue("pushEnabled"));
}
}
static void toJson(Http2Settings obj, JsonObject json) {
json.put("headerTableSize", obj.getHeaderTableSize());
json.put("initialWindowSize", obj.getInitialWindowSize());
json.put("maxConcurrentStreams", obj.getMaxConcurrentStreams());
json.put("maxFrameSize", obj.getMaxFrameSize());
json.put("maxHeaderListSize", obj.getMaxHeaderListSize());
json.put("pushEnabled", obj.isPushEnabled());
}
}

View File

@@ -0,0 +1,149 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.http;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.http.HttpClientOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.http.HttpClientOptions} original class using Vert.x codegen.
*/
class HttpClientOptionsConverter {
static void fromJson(JsonObject json, HttpClientOptions obj) {
if (json.getValue("alpnVersions") instanceof JsonArray) {
java.util.ArrayList<io.vertx.core.http.HttpVersion> list = new java.util.ArrayList<>();
json.getJsonArray("alpnVersions").forEach( item -> {
if (item instanceof String)
list.add(io.vertx.core.http.HttpVersion.valueOf((String)item));
});
obj.setAlpnVersions(list);
}
if (json.getValue("decoderInitialBufferSize") instanceof Number) {
obj.setDecoderInitialBufferSize(((Number)json.getValue("decoderInitialBufferSize")).intValue());
}
if (json.getValue("defaultHost") instanceof String) {
obj.setDefaultHost((String)json.getValue("defaultHost"));
}
if (json.getValue("defaultPort") instanceof Number) {
obj.setDefaultPort(((Number)json.getValue("defaultPort")).intValue());
}
if (json.getValue("forceSni") instanceof Boolean) {
obj.setForceSni((Boolean)json.getValue("forceSni"));
}
if (json.getValue("http2ClearTextUpgrade") instanceof Boolean) {
obj.setHttp2ClearTextUpgrade((Boolean)json.getValue("http2ClearTextUpgrade"));
}
if (json.getValue("http2ConnectionWindowSize") instanceof Number) {
obj.setHttp2ConnectionWindowSize(((Number)json.getValue("http2ConnectionWindowSize")).intValue());
}
if (json.getValue("http2MaxPoolSize") instanceof Number) {
obj.setHttp2MaxPoolSize(((Number)json.getValue("http2MaxPoolSize")).intValue());
}
if (json.getValue("http2MultiplexingLimit") instanceof Number) {
obj.setHttp2MultiplexingLimit(((Number)json.getValue("http2MultiplexingLimit")).intValue());
}
if (json.getValue("initialSettings") instanceof JsonObject) {
obj.setInitialSettings(new io.vertx.core.http.Http2Settings((JsonObject)json.getValue("initialSettings")));
}
if (json.getValue("keepAlive") instanceof Boolean) {
obj.setKeepAlive((Boolean)json.getValue("keepAlive"));
}
if (json.getValue("maxChunkSize") instanceof Number) {
obj.setMaxChunkSize(((Number)json.getValue("maxChunkSize")).intValue());
}
if (json.getValue("maxHeaderSize") instanceof Number) {
obj.setMaxHeaderSize(((Number)json.getValue("maxHeaderSize")).intValue());
}
if (json.getValue("maxInitialLineLength") instanceof Number) {
obj.setMaxInitialLineLength(((Number)json.getValue("maxInitialLineLength")).intValue());
}
if (json.getValue("maxPoolSize") instanceof Number) {
obj.setMaxPoolSize(((Number)json.getValue("maxPoolSize")).intValue());
}
if (json.getValue("maxRedirects") instanceof Number) {
obj.setMaxRedirects(((Number)json.getValue("maxRedirects")).intValue());
}
if (json.getValue("maxWaitQueueSize") instanceof Number) {
obj.setMaxWaitQueueSize(((Number)json.getValue("maxWaitQueueSize")).intValue());
}
if (json.getValue("maxWebsocketFrameSize") instanceof Number) {
obj.setMaxWebsocketFrameSize(((Number)json.getValue("maxWebsocketFrameSize")).intValue());
}
if (json.getValue("maxWebsocketMessageSize") instanceof Number) {
obj.setMaxWebsocketMessageSize(((Number)json.getValue("maxWebsocketMessageSize")).intValue());
}
if (json.getValue("pipelining") instanceof Boolean) {
obj.setPipelining((Boolean)json.getValue("pipelining"));
}
if (json.getValue("pipeliningLimit") instanceof Number) {
obj.setPipeliningLimit(((Number)json.getValue("pipeliningLimit")).intValue());
}
if (json.getValue("protocolVersion") instanceof String) {
obj.setProtocolVersion(io.vertx.core.http.HttpVersion.valueOf((String)json.getValue("protocolVersion")));
}
if (json.getValue("sendUnmaskedFrames") instanceof Boolean) {
obj.setSendUnmaskedFrames((Boolean)json.getValue("sendUnmaskedFrames"));
}
if (json.getValue("tryUseCompression") instanceof Boolean) {
obj.setTryUseCompression((Boolean)json.getValue("tryUseCompression"));
}
if (json.getValue("verifyHost") instanceof Boolean) {
obj.setVerifyHost((Boolean)json.getValue("verifyHost"));
}
}
static void toJson(HttpClientOptions obj, JsonObject json) {
if (obj.getAlpnVersions() != null) {
JsonArray array = new JsonArray();
obj.getAlpnVersions().forEach(item -> array.add(item.name()));
json.put("alpnVersions", array);
}
json.put("decoderInitialBufferSize", obj.getDecoderInitialBufferSize());
if (obj.getDefaultHost() != null) {
json.put("defaultHost", obj.getDefaultHost());
}
json.put("defaultPort", obj.getDefaultPort());
json.put("forceSni", obj.isForceSni());
json.put("http2ClearTextUpgrade", obj.isHttp2ClearTextUpgrade());
json.put("http2ConnectionWindowSize", obj.getHttp2ConnectionWindowSize());
json.put("http2MaxPoolSize", obj.getHttp2MaxPoolSize());
json.put("http2MultiplexingLimit", obj.getHttp2MultiplexingLimit());
if (obj.getInitialSettings() != null) {
json.put("initialSettings", obj.getInitialSettings().toJson());
}
json.put("keepAlive", obj.isKeepAlive());
json.put("maxChunkSize", obj.getMaxChunkSize());
json.put("maxHeaderSize", obj.getMaxHeaderSize());
json.put("maxInitialLineLength", obj.getMaxInitialLineLength());
json.put("maxPoolSize", obj.getMaxPoolSize());
json.put("maxRedirects", obj.getMaxRedirects());
json.put("maxWaitQueueSize", obj.getMaxWaitQueueSize());
json.put("maxWebsocketFrameSize", obj.getMaxWebsocketFrameSize());
json.put("maxWebsocketMessageSize", obj.getMaxWebsocketMessageSize());
json.put("pipelining", obj.isPipelining());
json.put("pipeliningLimit", obj.getPipeliningLimit());
if (obj.getProtocolVersion() != null) {
json.put("protocolVersion", obj.getProtocolVersion().name());
}
json.put("sendUnmaskedFrames", obj.isSendUnmaskedFrames());
json.put("tryUseCompression", obj.isTryUseCompression());
json.put("verifyHost", obj.isVerifyHost());
}
}

View File

@@ -0,0 +1,107 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.http;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.http.HttpServerOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.http.HttpServerOptions} original class using Vert.x codegen.
*/
class HttpServerOptionsConverter {
static void fromJson(JsonObject json, HttpServerOptions obj) {
if (json.getValue("acceptUnmaskedFrames") instanceof Boolean) {
obj.setAcceptUnmaskedFrames((Boolean)json.getValue("acceptUnmaskedFrames"));
}
if (json.getValue("alpnVersions") instanceof JsonArray) {
java.util.ArrayList<io.vertx.core.http.HttpVersion> list = new java.util.ArrayList<>();
json.getJsonArray("alpnVersions").forEach( item -> {
if (item instanceof String)
list.add(io.vertx.core.http.HttpVersion.valueOf((String)item));
});
obj.setAlpnVersions(list);
}
if (json.getValue("compressionLevel") instanceof Number) {
obj.setCompressionLevel(((Number)json.getValue("compressionLevel")).intValue());
}
if (json.getValue("compressionSupported") instanceof Boolean) {
obj.setCompressionSupported((Boolean)json.getValue("compressionSupported"));
}
if (json.getValue("decoderInitialBufferSize") instanceof Number) {
obj.setDecoderInitialBufferSize(((Number)json.getValue("decoderInitialBufferSize")).intValue());
}
if (json.getValue("decompressionSupported") instanceof Boolean) {
obj.setDecompressionSupported((Boolean)json.getValue("decompressionSupported"));
}
if (json.getValue("handle100ContinueAutomatically") instanceof Boolean) {
obj.setHandle100ContinueAutomatically((Boolean)json.getValue("handle100ContinueAutomatically"));
}
if (json.getValue("http2ConnectionWindowSize") instanceof Number) {
obj.setHttp2ConnectionWindowSize(((Number)json.getValue("http2ConnectionWindowSize")).intValue());
}
if (json.getValue("initialSettings") instanceof JsonObject) {
obj.setInitialSettings(new io.vertx.core.http.Http2Settings((JsonObject)json.getValue("initialSettings")));
}
if (json.getValue("maxChunkSize") instanceof Number) {
obj.setMaxChunkSize(((Number)json.getValue("maxChunkSize")).intValue());
}
if (json.getValue("maxHeaderSize") instanceof Number) {
obj.setMaxHeaderSize(((Number)json.getValue("maxHeaderSize")).intValue());
}
if (json.getValue("maxInitialLineLength") instanceof Number) {
obj.setMaxInitialLineLength(((Number)json.getValue("maxInitialLineLength")).intValue());
}
if (json.getValue("maxWebsocketFrameSize") instanceof Number) {
obj.setMaxWebsocketFrameSize(((Number)json.getValue("maxWebsocketFrameSize")).intValue());
}
if (json.getValue("maxWebsocketMessageSize") instanceof Number) {
obj.setMaxWebsocketMessageSize(((Number)json.getValue("maxWebsocketMessageSize")).intValue());
}
if (json.getValue("websocketSubProtocols") instanceof String) {
obj.setWebsocketSubProtocols((String)json.getValue("websocketSubProtocols"));
}
}
static void toJson(HttpServerOptions obj, JsonObject json) {
json.put("acceptUnmaskedFrames", obj.isAcceptUnmaskedFrames());
if (obj.getAlpnVersions() != null) {
JsonArray array = new JsonArray();
obj.getAlpnVersions().forEach(item -> array.add(item.name()));
json.put("alpnVersions", array);
}
json.put("compressionLevel", obj.getCompressionLevel());
json.put("compressionSupported", obj.isCompressionSupported());
json.put("decoderInitialBufferSize", obj.getDecoderInitialBufferSize());
json.put("decompressionSupported", obj.isDecompressionSupported());
json.put("handle100ContinueAutomatically", obj.isHandle100ContinueAutomatically());
json.put("http2ConnectionWindowSize", obj.getHttp2ConnectionWindowSize());
if (obj.getInitialSettings() != null) {
json.put("initialSettings", obj.getInitialSettings().toJson());
}
json.put("maxChunkSize", obj.getMaxChunkSize());
json.put("maxHeaderSize", obj.getMaxHeaderSize());
json.put("maxInitialLineLength", obj.getMaxInitialLineLength());
json.put("maxWebsocketFrameSize", obj.getMaxWebsocketFrameSize());
json.put("maxWebsocketMessageSize", obj.getMaxWebsocketMessageSize());
if (obj.getWebsocketSubProtocols() != null) {
json.put("websocketSubProtocols", obj.getWebsocketSubProtocols());
}
}
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.metrics;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.metrics.MetricsOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.metrics.MetricsOptions} original class using Vert.x codegen.
*/
class MetricsOptionsConverter {
static void fromJson(JsonObject json, MetricsOptions obj) {
if (json.getValue("enabled") instanceof Boolean) {
obj.setEnabled((Boolean)json.getValue("enabled"));
}
}
static void toJson(MetricsOptions obj, JsonObject json) {
json.put("enabled", obj.isEnabled());
}
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.ClientOptionsBase}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.ClientOptionsBase} original class using Vert.x codegen.
*/
class ClientOptionsBaseConverter {
static void fromJson(JsonObject json, ClientOptionsBase obj) {
if (json.getValue("connectTimeout") instanceof Number) {
obj.setConnectTimeout(((Number)json.getValue("connectTimeout")).intValue());
}
if (json.getValue("localAddress") instanceof String) {
obj.setLocalAddress((String)json.getValue("localAddress"));
}
if (json.getValue("metricsName") instanceof String) {
obj.setMetricsName((String)json.getValue("metricsName"));
}
if (json.getValue("proxyOptions") instanceof JsonObject) {
obj.setProxyOptions(new io.vertx.core.net.ProxyOptions((JsonObject)json.getValue("proxyOptions")));
}
if (json.getValue("trustAll") instanceof Boolean) {
obj.setTrustAll((Boolean)json.getValue("trustAll"));
}
}
static void toJson(ClientOptionsBase obj, JsonObject json) {
json.put("connectTimeout", obj.getConnectTimeout());
if (obj.getLocalAddress() != null) {
json.put("localAddress", obj.getLocalAddress());
}
if (obj.getMetricsName() != null) {
json.put("metricsName", obj.getMetricsName());
}
if (obj.getProxyOptions() != null) {
json.put("proxyOptions", obj.getProxyOptions().toJson());
}
json.put("trustAll", obj.isTrustAll());
}
}

View File

@@ -0,0 +1,52 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.JksOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.JksOptions} original class using Vert.x codegen.
*/
public class JksOptionsConverter {
public static void fromJson(JsonObject json, JksOptions obj) {
if (json.getValue("password") instanceof String) {
obj.setPassword((String)json.getValue("password"));
}
if (json.getValue("path") instanceof String) {
obj.setPath((String)json.getValue("path"));
}
if (json.getValue("value") instanceof String) {
obj.setValue(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)json.getValue("value"))));
}
}
public static void toJson(JksOptions obj, JsonObject json) {
if (obj.getPassword() != null) {
json.put("password", obj.getPassword());
}
if (obj.getPath() != null) {
json.put("path", obj.getPath());
}
if (obj.getValue() != null) {
json.put("value", obj.getValue().getBytes());
}
}
}

View File

@@ -0,0 +1,48 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.NetClientOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.NetClientOptions} original class using Vert.x codegen.
*/
class NetClientOptionsConverter {
static void fromJson(JsonObject json, NetClientOptions obj) {
if (json.getValue("hostnameVerificationAlgorithm") instanceof String) {
obj.setHostnameVerificationAlgorithm((String)json.getValue("hostnameVerificationAlgorithm"));
}
if (json.getValue("reconnectAttempts") instanceof Number) {
obj.setReconnectAttempts(((Number)json.getValue("reconnectAttempts")).intValue());
}
if (json.getValue("reconnectInterval") instanceof Number) {
obj.setReconnectInterval(((Number)json.getValue("reconnectInterval")).longValue());
}
}
static void toJson(NetClientOptions obj, JsonObject json) {
if (obj.getHostnameVerificationAlgorithm() != null) {
json.put("hostnameVerificationAlgorithm", obj.getHostnameVerificationAlgorithm());
}
json.put("reconnectAttempts", obj.getReconnectAttempts());
json.put("reconnectInterval", obj.getReconnectInterval());
}
}

View File

@@ -0,0 +1,62 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.NetServerOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.NetServerOptions} original class using Vert.x codegen.
*/
class NetServerOptionsConverter {
static void fromJson(JsonObject json, NetServerOptions obj) {
if (json.getValue("acceptBacklog") instanceof Number) {
obj.setAcceptBacklog(((Number)json.getValue("acceptBacklog")).intValue());
}
if (json.getValue("clientAuth") instanceof String) {
obj.setClientAuth(io.vertx.core.http.ClientAuth.valueOf((String)json.getValue("clientAuth")));
}
if (json.getValue("clientAuthRequired") instanceof Boolean) {
obj.setClientAuthRequired((Boolean)json.getValue("clientAuthRequired"));
}
if (json.getValue("host") instanceof String) {
obj.setHost((String)json.getValue("host"));
}
if (json.getValue("port") instanceof Number) {
obj.setPort(((Number)json.getValue("port")).intValue());
}
if (json.getValue("sni") instanceof Boolean) {
obj.setSni((Boolean)json.getValue("sni"));
}
}
static void toJson(NetServerOptions obj, JsonObject json) {
json.put("acceptBacklog", obj.getAcceptBacklog());
if (obj.getClientAuth() != null) {
json.put("clientAuth", obj.getClientAuth().name());
}
json.put("clientAuthRequired", obj.isClientAuthRequired());
if (obj.getHost() != null) {
json.put("host", obj.getHost());
}
json.put("port", obj.getPort());
json.put("sni", obj.isSni());
}
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.NetworkOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.NetworkOptions} original class using Vert.x codegen.
*/
class NetworkOptionsConverter {
static void fromJson(JsonObject json, NetworkOptions obj) {
if (json.getValue("logActivity") instanceof Boolean) {
obj.setLogActivity((Boolean)json.getValue("logActivity"));
}
if (json.getValue("receiveBufferSize") instanceof Number) {
obj.setReceiveBufferSize(((Number)json.getValue("receiveBufferSize")).intValue());
}
if (json.getValue("reuseAddress") instanceof Boolean) {
obj.setReuseAddress((Boolean)json.getValue("reuseAddress"));
}
if (json.getValue("reusePort") instanceof Boolean) {
obj.setReusePort((Boolean)json.getValue("reusePort"));
}
if (json.getValue("sendBufferSize") instanceof Number) {
obj.setSendBufferSize(((Number)json.getValue("sendBufferSize")).intValue());
}
if (json.getValue("trafficClass") instanceof Number) {
obj.setTrafficClass(((Number)json.getValue("trafficClass")).intValue());
}
}
static void toJson(NetworkOptions obj, JsonObject json) {
json.put("logActivity", obj.getLogActivity());
json.put("receiveBufferSize", obj.getReceiveBufferSize());
json.put("reuseAddress", obj.isReuseAddress());
json.put("reusePort", obj.isReusePort());
json.put("sendBufferSize", obj.getSendBufferSize());
json.put("trafficClass", obj.getTrafficClass());
}
}

View File

@@ -0,0 +1,40 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.OpenSSLEngineOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.OpenSSLEngineOptions} original class using Vert.x codegen.
*/
class OpenSSLEngineOptionsConverter {
static void fromJson(JsonObject json, OpenSSLEngineOptions obj) {
if (json.getValue("sessionCacheEnabled") instanceof Boolean) {
obj.setSessionCacheEnabled((Boolean)json.getValue("sessionCacheEnabled"));
}
}
static void toJson(OpenSSLEngineOptions obj, JsonObject json) {
json.put("alpnAvailable", obj.isAlpnAvailable());
json.put("available", obj.isAvailable());
json.put("sessionCacheEnabled", obj.isSessionCacheEnabled());
}
}

View File

@@ -0,0 +1,98 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.PemKeyCertOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.PemKeyCertOptions} original class using Vert.x codegen.
*/
class PemKeyCertOptionsConverter {
static void fromJson(JsonObject json, PemKeyCertOptions obj) {
if (json.getValue("certPath") instanceof String) {
obj.setCertPath((String)json.getValue("certPath"));
}
if (json.getValue("certPaths") instanceof JsonArray) {
java.util.ArrayList<java.lang.String> list = new java.util.ArrayList<>();
json.getJsonArray("certPaths").forEach( item -> {
if (item instanceof String)
list.add((String)item);
});
obj.setCertPaths(list);
}
if (json.getValue("certValue") instanceof String) {
obj.setCertValue(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)json.getValue("certValue"))));
}
if (json.getValue("certValues") instanceof JsonArray) {
java.util.ArrayList<io.vertx.core.buffer.Buffer> list = new java.util.ArrayList<>();
json.getJsonArray("certValues").forEach( item -> {
if (item instanceof String)
list.add(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)item)));
});
obj.setCertValues(list);
}
if (json.getValue("keyPath") instanceof String) {
obj.setKeyPath((String)json.getValue("keyPath"));
}
if (json.getValue("keyPaths") instanceof JsonArray) {
java.util.ArrayList<java.lang.String> list = new java.util.ArrayList<>();
json.getJsonArray("keyPaths").forEach( item -> {
if (item instanceof String)
list.add((String)item);
});
obj.setKeyPaths(list);
}
if (json.getValue("keyValue") instanceof String) {
obj.setKeyValue(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)json.getValue("keyValue"))));
}
if (json.getValue("keyValues") instanceof JsonArray) {
java.util.ArrayList<io.vertx.core.buffer.Buffer> list = new java.util.ArrayList<>();
json.getJsonArray("keyValues").forEach( item -> {
if (item instanceof String)
list.add(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)item)));
});
obj.setKeyValues(list);
}
}
static void toJson(PemKeyCertOptions obj, JsonObject json) {
if (obj.getCertPaths() != null) {
JsonArray array = new JsonArray();
obj.getCertPaths().forEach(item -> array.add(item));
json.put("certPaths", array);
}
if (obj.getCertValues() != null) {
JsonArray array = new JsonArray();
obj.getCertValues().forEach(item -> array.add(item.getBytes()));
json.put("certValues", array);
}
if (obj.getKeyPaths() != null) {
JsonArray array = new JsonArray();
obj.getKeyPaths().forEach(item -> array.add(item));
json.put("keyPaths", array);
}
if (obj.getKeyValues() != null) {
JsonArray array = new JsonArray();
obj.getKeyValues().forEach(item -> array.add(item.getBytes()));
json.put("keyValues", array);
}
}
}

View File

@@ -0,0 +1,56 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.PemTrustOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.PemTrustOptions} original class using Vert.x codegen.
*/
class PemTrustOptionsConverter {
static void fromJson(JsonObject json, PemTrustOptions obj) {
if (json.getValue("certPaths") instanceof JsonArray) {
json.getJsonArray("certPaths").forEach(item -> {
if (item instanceof String)
obj.addCertPath((String)item);
});
}
if (json.getValue("certValues") instanceof JsonArray) {
json.getJsonArray("certValues").forEach(item -> {
if (item instanceof String)
obj.addCertValue(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)item)));
});
}
}
static void toJson(PemTrustOptions obj, JsonObject json) {
if (obj.getCertPaths() != null) {
JsonArray array = new JsonArray();
obj.getCertPaths().forEach(item -> array.add(item));
json.put("certPaths", array);
}
if (obj.getCertValues() != null) {
JsonArray array = new JsonArray();
obj.getCertValues().forEach(item -> array.add(item.getBytes()));
json.put("certValues", array);
}
}
}

View File

@@ -0,0 +1,52 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.PfxOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.PfxOptions} original class using Vert.x codegen.
*/
class PfxOptionsConverter {
static void fromJson(JsonObject json, PfxOptions obj) {
if (json.getValue("password") instanceof String) {
obj.setPassword((String)json.getValue("password"));
}
if (json.getValue("path") instanceof String) {
obj.setPath((String)json.getValue("path"));
}
if (json.getValue("value") instanceof String) {
obj.setValue(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)json.getValue("value"))));
}
}
static void toJson(PfxOptions obj, JsonObject json) {
if (obj.getPassword() != null) {
json.put("password", obj.getPassword());
}
if (obj.getPath() != null) {
json.put("path", obj.getPath());
}
if (obj.getValue() != null) {
json.put("value", obj.getValue().getBytes());
}
}
}

View File

@@ -0,0 +1,62 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.ProxyOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.ProxyOptions} original class using Vert.x codegen.
*/
class ProxyOptionsConverter {
static void fromJson(JsonObject json, ProxyOptions obj) {
if (json.getValue("host") instanceof String) {
obj.setHost((String)json.getValue("host"));
}
if (json.getValue("password") instanceof String) {
obj.setPassword((String)json.getValue("password"));
}
if (json.getValue("port") instanceof Number) {
obj.setPort(((Number)json.getValue("port")).intValue());
}
if (json.getValue("type") instanceof String) {
obj.setType(io.vertx.core.net.ProxyType.valueOf((String)json.getValue("type")));
}
if (json.getValue("username") instanceof String) {
obj.setUsername((String)json.getValue("username"));
}
}
static void toJson(ProxyOptions obj, JsonObject json) {
if (obj.getHost() != null) {
json.put("host", obj.getHost());
}
if (obj.getPassword() != null) {
json.put("password", obj.getPassword());
}
json.put("port", obj.getPort());
if (obj.getType() != null) {
json.put("type", obj.getType().name());
}
if (obj.getUsername() != null) {
json.put("username", obj.getUsername());
}
}
}

View File

@@ -0,0 +1,166 @@
/*
* Copyright 2014 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.vertx.core.net;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
/**
* Converter for {@link io.vertx.core.net.TCPSSLOptions}.
*
* NOTE: This class has been automatically generated from the {@link io.vertx.core.net.TCPSSLOptions} original class using Vert.x codegen.
*/
class TCPSSLOptionsConverter {
static void fromJson(JsonObject json, TCPSSLOptions obj) {
if (json.getValue("crlPaths") instanceof JsonArray) {
json.getJsonArray("crlPaths").forEach(item -> {
if (item instanceof String)
obj.addCrlPath((String)item);
});
}
if (json.getValue("crlValues") instanceof JsonArray) {
json.getJsonArray("crlValues").forEach(item -> {
if (item instanceof String)
obj.addCrlValue(io.vertx.core.buffer.Buffer.buffer(java.util.Base64.getDecoder().decode((String)item)));
});
}
if (json.getValue("enabledCipherSuites") instanceof JsonArray) {
json.getJsonArray("enabledCipherSuites").forEach(item -> {
if (item instanceof String)
obj.addEnabledCipherSuite((String)item);
});
}
if (json.getValue("enabledSecureTransportProtocols") instanceof JsonArray) {
json.getJsonArray("enabledSecureTransportProtocols").forEach(item -> {
if (item instanceof String)
obj.addEnabledSecureTransportProtocol((String)item);
});
}
if (json.getValue("idleTimeout") instanceof Number) {
obj.setIdleTimeout(((Number)json.getValue("idleTimeout")).intValue());
}
if (json.getValue("jdkSslEngineOptions") instanceof JsonObject) {
obj.setJdkSslEngineOptions(new io.vertx.core.net.JdkSSLEngineOptions((JsonObject)json.getValue("jdkSslEngineOptions")));
}
if (json.getValue("keyStoreOptions") instanceof JsonObject) {
obj.setKeyStoreOptions(new io.vertx.core.net.JksOptions((JsonObject)json.getValue("keyStoreOptions")));
}
if (json.getValue("openSslEngineOptions") instanceof JsonObject) {
obj.setOpenSslEngineOptions(new io.vertx.core.net.OpenSSLEngineOptions((JsonObject)json.getValue("openSslEngineOptions")));
}
if (json.getValue("pemKeyCertOptions") instanceof JsonObject) {
obj.setPemKeyCertOptions(new io.vertx.core.net.PemKeyCertOptions((JsonObject)json.getValue("pemKeyCertOptions")));
}
if (json.getValue("pemTrustOptions") instanceof JsonObject) {
obj.setPemTrustOptions(new io.vertx.core.net.PemTrustOptions((JsonObject)json.getValue("pemTrustOptions")));
}
if (json.getValue("pfxKeyCertOptions") instanceof JsonObject) {
obj.setPfxKeyCertOptions(new io.vertx.core.net.PfxOptions((JsonObject)json.getValue("pfxKeyCertOptions")));
}
if (json.getValue("pfxTrustOptions") instanceof JsonObject) {
obj.setPfxTrustOptions(new io.vertx.core.net.PfxOptions((JsonObject)json.getValue("pfxTrustOptions")));
}
if (json.getValue("soLinger") instanceof Number) {
obj.setSoLinger(((Number)json.getValue("soLinger")).intValue());
}
if (json.getValue("ssl") instanceof Boolean) {
obj.setSsl((Boolean)json.getValue("ssl"));
}
if (json.getValue("tcpCork") instanceof Boolean) {
obj.setTcpCork((Boolean)json.getValue("tcpCork"));
}
if (json.getValue("tcpFastOpen") instanceof Boolean) {
obj.setTcpFastOpen((Boolean)json.getValue("tcpFastOpen"));
}
if (json.getValue("tcpKeepAlive") instanceof Boolean) {
obj.setTcpKeepAlive((Boolean)json.getValue("tcpKeepAlive"));
}
if (json.getValue("tcpNoDelay") instanceof Boolean) {
obj.setTcpNoDelay((Boolean)json.getValue("tcpNoDelay"));
}
if (json.getValue("tcpQuickAck") instanceof Boolean) {
obj.setTcpQuickAck((Boolean)json.getValue("tcpQuickAck"));
}
if (json.getValue("trustStoreOptions") instanceof JsonObject) {
obj.setTrustStoreOptions(new io.vertx.core.net.JksOptions((JsonObject)json.getValue("trustStoreOptions")));
}
if (json.getValue("useAlpn") instanceof Boolean) {
obj.setUseAlpn((Boolean)json.getValue("useAlpn"));
}
if (json.getValue("usePooledBuffers") instanceof Boolean) {
obj.setUsePooledBuffers((Boolean)json.getValue("usePooledBuffers"));
}
}
static void toJson(TCPSSLOptions obj, JsonObject json) {
if (obj.getCrlPaths() != null) {
JsonArray array = new JsonArray();
obj.getCrlPaths().forEach(item -> array.add(item));
json.put("crlPaths", array);
}
if (obj.getCrlValues() != null) {
JsonArray array = new JsonArray();
obj.getCrlValues().forEach(item -> array.add(item.getBytes()));
json.put("crlValues", array);
}
if (obj.getEnabledCipherSuites() != null) {
JsonArray array = new JsonArray();
obj.getEnabledCipherSuites().forEach(item -> array.add(item));
json.put("enabledCipherSuites", array);
}
if (obj.getEnabledSecureTransportProtocols() != null) {
JsonArray array = new JsonArray();
obj.getEnabledSecureTransportProtocols().forEach(item -> array.add(item));
json.put("enabledSecureTransportProtocols", array);
}
json.put("idleTimeout", obj.getIdleTimeout());
if (obj.getJdkSslEngineOptions() != null) {
json.put("jdkSslEngineOptions", obj.getJdkSslEngineOptions().toJson());
}
if (obj.getKeyStoreOptions() != null) {
json.put("keyStoreOptions", obj.getKeyStoreOptions().toJson());
}
if (obj.getOpenSslEngineOptions() != null) {
json.put("openSslEngineOptions", obj.getOpenSslEngineOptions().toJson());
}
if (obj.getPemKeyCertOptions() != null) {
json.put("pemKeyCertOptions", obj.getPemKeyCertOptions().toJson());
}
if (obj.getPemTrustOptions() != null) {
json.put("pemTrustOptions", obj.getPemTrustOptions().toJson());
}
if (obj.getPfxKeyCertOptions() != null) {
json.put("pfxKeyCertOptions", obj.getPfxKeyCertOptions().toJson());
}
if (obj.getPfxTrustOptions() != null) {
json.put("pfxTrustOptions", obj.getPfxTrustOptions().toJson());
}
json.put("soLinger", obj.getSoLinger());
json.put("ssl", obj.isSsl());
json.put("tcpCork", obj.isTcpCork());
json.put("tcpFastOpen", obj.isTcpFastOpen());
json.put("tcpKeepAlive", obj.isTcpKeepAlive());
json.put("tcpNoDelay", obj.isTcpNoDelay());
json.put("tcpQuickAck", obj.isTcpQuickAck());
if (obj.getTrustStoreOptions() != null) {
json.put("trustStoreOptions", obj.getTrustStoreOptions().toJson());
}
json.put("useAlpn", obj.isUseAlpn());
json.put("usePooledBuffers", obj.isUsePooledBuffers());
}
}