Skip to content

Commit

Permalink
Adapt to EventLoopContext interface removal
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Sep 18, 2023
1 parent d55c915 commit cbe76df
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public class PoolOptionsConverter {
public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, PoolOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "name":
if (member.getValue() instanceof String) {
obj.setName((String)member.getValue());
}
break;
case "cleanerInterval":
if (member.getValue() instanceof Number) {
obj.setCleanerInterval(((Number)member.getValue()).intValue());
Expand All @@ -35,11 +40,6 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
obj.setMaxWaiting(((Number)member.getValue()).intValue());
}
break;
case "name":
if (member.getValue() instanceof String) {
obj.setName((String)member.getValue());
}
break;
case "recycleTimeout":
if (member.getValue() instanceof Number) {
obj.setRecycleTimeout(((Number)member.getValue()).intValue());
Expand All @@ -54,12 +54,12 @@ public static void toJson(PoolOptions obj, JsonObject json) {
}

public static void toJson(PoolOptions obj, java.util.Map<String, Object> json) {
json.put("cleanerInterval", obj.getCleanerInterval());
json.put("maxSize", obj.getMaxSize());
json.put("maxWaiting", obj.getMaxWaiting());
if (obj.getName() != null) {
json.put("name", obj.getName());
}
json.put("cleanerInterval", obj.getCleanerInterval());
json.put("maxSize", obj.getMaxSize());
json.put("maxWaiting", obj.getMaxWaiting());
json.put("recycleTimeout", obj.getRecycleTimeout());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,51 @@ public class RedisConnectOptionsConverter {
public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisConnectOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "connectionString":
case "maxNestedArrays":
if (member.getValue() instanceof Number) {
obj.setMaxNestedArrays(((Number)member.getValue()).intValue());
}
break;
case "protocolNegotiation":
if (member.getValue() instanceof Boolean) {
obj.setProtocolNegotiation((Boolean)member.getValue());
}
break;
case "password":
if (member.getValue() instanceof String) {
obj.setConnectionString((String)member.getValue());
obj.setPassword((String)member.getValue());
}
break;
case "connectionStrings":
case "endpoints":
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)
obj.addConnectionString((String)item);
list.add((String)item);
});
obj.setEndpoints(list);
}
break;
case "endpoint":
break;
case "endpoints":
case "connectionStrings":
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.addConnectionString((String)item);
});
obj.setEndpoints(list);
}
break;
case "maxNestedArrays":
if (member.getValue() instanceof Number) {
obj.setMaxNestedArrays(((Number)member.getValue()).intValue());
case "connectionString":
if (member.getValue() instanceof String) {
obj.setConnectionString((String)member.getValue());
}
break;
case "maxWaitingHandlers":
if (member.getValue() instanceof Number) {
obj.setMaxWaitingHandlers(((Number)member.getValue()).intValue());
}
break;
case "password":
if (member.getValue() instanceof String) {
obj.setPassword((String)member.getValue());
}
break;
case "protocolNegotiation":
if (member.getValue() instanceof Boolean) {
obj.setProtocolNegotiation((Boolean)member.getValue());
}
break;
}
}
}
Expand All @@ -74,19 +74,19 @@ public static void toJson(RedisConnectOptions obj, JsonObject json) {
}

public static void toJson(RedisConnectOptions obj, java.util.Map<String, Object> json) {
if (obj.getEndpoint() != null) {
json.put("endpoint", obj.getEndpoint());
json.put("maxNestedArrays", obj.getMaxNestedArrays());
json.put("protocolNegotiation", obj.isProtocolNegotiation());
if (obj.getPassword() != null) {
json.put("password", obj.getPassword());
}
if (obj.getEndpoints() != null) {
JsonArray array = new JsonArray();
obj.getEndpoints().forEach(item -> array.add(item));
json.put("endpoints", array);
}
json.put("maxNestedArrays", obj.getMaxNestedArrays());
json.put("maxWaitingHandlers", obj.getMaxWaitingHandlers());
if (obj.getPassword() != null) {
json.put("password", obj.getPassword());
if (obj.getEndpoint() != null) {
json.put("endpoint", obj.getEndpoint());
}
json.put("protocolNegotiation", obj.isProtocolNegotiation());
json.put("maxWaitingHandlers", obj.getMaxWaitingHandlers());
}
}
134 changes: 67 additions & 67 deletions src/main/generated/io/vertx/redis/client/RedisOptionsConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,107 +20,107 @@ public class RedisOptionsConverter {
public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "connectionString":
case "type":
if (member.getValue() instanceof String) {
obj.setConnectionString((String)member.getValue());
obj.setType(io.vertx.redis.client.RedisClientType.valueOf((String)member.getValue()));
}
break;
case "connectionStrings":
case "netClientOptions":
if (member.getValue() instanceof JsonObject) {
obj.setNetClientOptions(new io.vertx.core.net.NetClientOptions((io.vertx.core.json.JsonObject)member.getValue()));
}
break;
case "endpoints":
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)
obj.addConnectionString((String)item);
list.add((String)item);
});
obj.setEndpoints(list);
}
break;
case "endpoint":
if (member.getValue() instanceof String) {
obj.setEndpoint((String)member.getValue());
}
break;
case "endpoints":
case "connectionStrings":
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.addConnectionString((String)item);
});
obj.setEndpoints(list);
}
break;
case "masterName":
case "connectionString":
if (member.getValue() instanceof String) {
obj.setMasterName((String)member.getValue());
obj.setConnectionString((String)member.getValue());
}
break;
case "maxNestedArrays":
case "maxWaitingHandlers":
if (member.getValue() instanceof Number) {
obj.setMaxNestedArrays(((Number)member.getValue()).intValue());
obj.setMaxWaitingHandlers(((Number)member.getValue()).intValue());
}
break;
case "maxPoolSize":
if (member.getValue() instanceof Number) {
obj.setMaxPoolSize(((Number)member.getValue()).intValue());
case "masterName":
if (member.getValue() instanceof String) {
obj.setMasterName((String)member.getValue());
}
break;
case "maxPoolWaiting":
if (member.getValue() instanceof Number) {
obj.setMaxPoolWaiting(((Number)member.getValue()).intValue());
case "role":
if (member.getValue() instanceof String) {
obj.setRole(io.vertx.redis.client.RedisRole.valueOf((String)member.getValue()));
}
break;
case "maxWaitingHandlers":
if (member.getValue() instanceof Number) {
obj.setMaxWaitingHandlers(((Number)member.getValue()).intValue());
case "useReplicas":
if (member.getValue() instanceof String) {
obj.setUseReplicas(io.vertx.redis.client.RedisReplicas.valueOf((String)member.getValue()));
}
break;
case "netClientOptions":
if (member.getValue() instanceof JsonObject) {
obj.setNetClientOptions(new io.vertx.core.net.NetClientOptions((io.vertx.core.json.JsonObject)member.getValue()));
case "maxNestedArrays":
if (member.getValue() instanceof Number) {
obj.setMaxNestedArrays(((Number)member.getValue()).intValue());
}
break;
case "password":
case "tracingPolicy":
if (member.getValue() instanceof String) {
obj.setPassword((String)member.getValue());
obj.setTracingPolicy(io.vertx.core.tracing.TracingPolicy.valueOf((String)member.getValue()));
}
break;
case "poolCleanerInterval":
if (member.getValue() instanceof Number) {
obj.setPoolCleanerInterval(((Number)member.getValue()).intValue());
}
break;
case "poolName":
if (member.getValue() instanceof String) {
obj.setPoolName((String)member.getValue());
}
break;
case "poolRecycleTimeout":
case "maxPoolSize":
if (member.getValue() instanceof Number) {
obj.setPoolRecycleTimeout(((Number)member.getValue()).intValue());
obj.setMaxPoolSize(((Number)member.getValue()).intValue());
}
break;
case "protocolNegotiation":
if (member.getValue() instanceof Boolean) {
obj.setProtocolNegotiation((Boolean)member.getValue());
case "maxPoolWaiting":
if (member.getValue() instanceof Number) {
obj.setMaxPoolWaiting(((Number)member.getValue()).intValue());
}
break;
case "role":
if (member.getValue() instanceof String) {
obj.setRole(io.vertx.redis.client.RedisRole.valueOf((String)member.getValue()));
case "poolRecycleTimeout":
if (member.getValue() instanceof Number) {
obj.setPoolRecycleTimeout(((Number)member.getValue()).intValue());
}
break;
case "tracingPolicy":
case "password":
if (member.getValue() instanceof String) {
obj.setTracingPolicy(io.vertx.core.tracing.TracingPolicy.valueOf((String)member.getValue()));
obj.setPassword((String)member.getValue());
}
break;
case "type":
if (member.getValue() instanceof String) {
obj.setType(io.vertx.redis.client.RedisClientType.valueOf((String)member.getValue()));
case "protocolNegotiation":
if (member.getValue() instanceof Boolean) {
obj.setProtocolNegotiation((Boolean)member.getValue());
}
break;
case "useReplicas":
case "poolName":
if (member.getValue() instanceof String) {
obj.setUseReplicas(io.vertx.redis.client.RedisReplicas.valueOf((String)member.getValue()));
obj.setPoolName((String)member.getValue());
}
break;
}
Expand All @@ -132,44 +132,44 @@ public static void toJson(RedisOptions obj, JsonObject json) {
}

public static void toJson(RedisOptions obj, java.util.Map<String, Object> json) {
if (obj.getEndpoint() != null) {
json.put("endpoint", obj.getEndpoint());
if (obj.getType() != null) {
json.put("type", obj.getType().name());
}
if (obj.getNetClientOptions() != null) {
json.put("netClientOptions", obj.getNetClientOptions().toJson());
}
if (obj.getEndpoints() != null) {
JsonArray array = new JsonArray();
obj.getEndpoints().forEach(item -> array.add(item));
json.put("endpoints", array);
}
if (obj.getEndpoint() != null) {
json.put("endpoint", obj.getEndpoint());
}
json.put("maxWaitingHandlers", obj.getMaxWaitingHandlers());
if (obj.getMasterName() != null) {
json.put("masterName", obj.getMasterName());
}
if (obj.getRole() != null) {
json.put("role", obj.getRole().name());
}
if (obj.getUseReplicas() != null) {
json.put("useReplicas", obj.getUseReplicas().name());
}
json.put("maxNestedArrays", obj.getMaxNestedArrays());
if (obj.getTracingPolicy() != null) {
json.put("tracingPolicy", obj.getTracingPolicy().name());
}
json.put("poolCleanerInterval", obj.getPoolCleanerInterval());
json.put("maxPoolSize", obj.getMaxPoolSize());
json.put("maxPoolWaiting", obj.getMaxPoolWaiting());
json.put("maxWaitingHandlers", obj.getMaxWaitingHandlers());
if (obj.getNetClientOptions() != null) {
json.put("netClientOptions", obj.getNetClientOptions().toJson());
}
json.put("poolRecycleTimeout", obj.getPoolRecycleTimeout());
if (obj.getPassword() != null) {
json.put("password", obj.getPassword());
}
json.put("poolCleanerInterval", obj.getPoolCleanerInterval());
json.put("protocolNegotiation", obj.isProtocolNegotiation());
if (obj.getPoolName() != null) {
json.put("poolName", obj.getPoolName());
}
json.put("poolRecycleTimeout", obj.getPoolRecycleTimeout());
json.put("protocolNegotiation", obj.isProtocolNegotiation());
if (obj.getRole() != null) {
json.put("role", obj.getRole().name());
}
if (obj.getTracingPolicy() != null) {
json.put("tracingPolicy", obj.getTracingPolicy().name());
}
if (obj.getType() != null) {
json.put("type", obj.getType().name());
}
if (obj.getUseReplicas() != null) {
json.put("useReplicas", obj.getUseReplicas().name());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public class RedisSentinelConnectOptionsConverter {
public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, RedisSentinelConnectOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "masterName":
case "role":
if (member.getValue() instanceof String) {
obj.setMasterName((String)member.getValue());
obj.setRole(io.vertx.redis.client.RedisRole.valueOf((String)member.getValue()));
}
break;
case "role":
case "masterName":
if (member.getValue() instanceof String) {
obj.setRole(io.vertx.redis.client.RedisRole.valueOf((String)member.getValue()));
obj.setMasterName((String)member.getValue());
}
break;
}
Expand All @@ -39,11 +39,11 @@ public static void toJson(RedisSentinelConnectOptions obj, JsonObject json) {
}

public static void toJson(RedisSentinelConnectOptions obj, java.util.Map<String, Object> json) {
if (obj.getMasterName() != null) {
json.put("masterName", obj.getMasterName());
}
if (obj.getRole() != null) {
json.put("role", obj.getRole().name());
}
if (obj.getMasterName() != null) {
json.put("masterName", obj.getMasterName());
}
}
}
Loading

0 comments on commit cbe76df

Please sign in to comment.