Skip to content

Commit

Permalink
Merge pull request #461 from Ladicek/regenerate-converters
Browse files Browse the repository at this point in the history
Regenerate converters
  • Loading branch information
Ladicek authored Aug 8, 2024
2 parents 632fd39 + 904cff3 commit c81cd37
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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;
Expand All @@ -13,9 +12,8 @@
*/
public class PoolOptionsConverter {


private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;
private static final Base64.Decoder BASE64_DECODER = Base64.getUrlDecoder();
private static final Base64.Encoder BASE64_ENCODER = Base64.getUrlEncoder().withoutPadding();

static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, PoolOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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;
Expand All @@ -13,9 +12,8 @@
*/
public class RedisClusterConnectOptionsConverter {


private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;
private static final Base64.Decoder BASE64_DECODER = Base64.getUrlDecoder();
private static final Base64.Encoder BASE64_ENCODER = Base64.getUrlEncoder().withoutPadding();

static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisClusterConnectOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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;
Expand All @@ -13,9 +12,8 @@
*/
public class RedisConnectOptionsConverter {


private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;
private static final Base64.Decoder BASE64_DECODER = Base64.getUrlDecoder();
private static final Base64.Encoder BASE64_ENCODER = Base64.getUrlEncoder().withoutPadding();

static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisConnectOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
Expand Down
22 changes: 10 additions & 12 deletions src/main/generated/io/vertx/redis/client/RedisOptionsConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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;
Expand All @@ -13,9 +12,8 @@
*/
public class RedisOptionsConverter {


private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;
private static final Base64.Decoder BASE64_DECODER = Base64.getUrlDecoder();
private static final Base64.Encoder BASE64_ENCODER = Base64.getUrlEncoder().withoutPadding();

static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
Expand All @@ -30,6 +28,11 @@ static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisOp
obj.setNetClientOptions(new io.vertx.core.net.NetClientOptions((io.vertx.core.json.JsonObject)member.getValue()));
}
break;
case "topology":
if (member.getValue() instanceof String) {
obj.setTopology(io.vertx.redis.client.RedisTopology.valueOf((String)member.getValue()));
}
break;
case "endpoints":
if (member.getValue() instanceof JsonArray) {
java.util.ArrayList<java.lang.String> list = new java.util.ArrayList<>();
Expand All @@ -40,11 +43,6 @@ static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisOp
obj.setEndpoints(list);
}
break;
case "topology":
if (member.getValue() instanceof String) {
obj.setTopology(io.vertx.redis.client.RedisTopology.valueOf((String)member.getValue()));
}
break;
case "maxWaitingHandlers":
if (member.getValue() instanceof Number) {
obj.setMaxWaitingHandlers(((Number)member.getValue()).intValue());
Expand Down Expand Up @@ -135,14 +133,14 @@ static void toJson(RedisOptions obj, java.util.Map<String, Object> json) {
if (obj.getNetClientOptions() != null) {
json.put("netClientOptions", obj.getNetClientOptions().toJson());
}
if (obj.getTopology() != null) {
json.put("topology", obj.getTopology().name());
}
if (obj.getEndpoints() != null) {
JsonArray array = new JsonArray();
obj.getEndpoints().forEach(item -> array.add(item));
json.put("endpoints", array);
}
if (obj.getTopology() != null) {
json.put("topology", obj.getTopology().name());
}
json.put("maxWaitingHandlers", obj.getMaxWaitingHandlers());
if (obj.getMasterName() != null) {
json.put("masterName", obj.getMasterName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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;
Expand All @@ -13,9 +12,8 @@
*/
public class RedisReplicationConnectOptionsConverter {


private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;
private static final Base64.Decoder BASE64_DECODER = Base64.getUrlDecoder();
private static final Base64.Encoder BASE64_ENCODER = Base64.getUrlEncoder().withoutPadding();

static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisReplicationConnectOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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;
Expand All @@ -13,9 +12,8 @@
*/
public class RedisSentinelConnectOptionsConverter {


private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;
private static final Base64.Decoder BASE64_DECODER = Base64.getUrlDecoder();
private static final Base64.Encoder BASE64_ENCODER = Base64.getUrlEncoder().withoutPadding();

static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisSentinelConnectOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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;
Expand All @@ -13,9 +12,8 @@
*/
public class RedisStandaloneConnectOptionsConverter {


private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;
private static final Base64.Decoder BASE64_DECODER = Base64.getUrlDecoder();
private static final Base64.Encoder BASE64_ENCODER = Base64.getUrlEncoder().withoutPadding();

static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisStandaloneConnectOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
Expand Down

0 comments on commit c81cd37

Please sign in to comment.