@@ -20,107 +20,107 @@ public class RedisOptionsConverter {
2020 public static void fromJson (Iterable <java .util .Map .Entry <String , Object >> json , RedisOptions obj ) {
2121 for (java .util .Map .Entry <String , Object > member : json ) {
2222 switch (member .getKey ()) {
23- case "connectionString " :
23+ case "type " :
2424 if (member .getValue () instanceof String ) {
25- obj .setConnectionString (( String )member .getValue ());
25+ obj .setType ( io . vertx . redis . client . RedisClientType . valueOf (( String )member .getValue () ));
2626 }
2727 break ;
28- case "connectionStrings" :
28+ case "netClientOptions" :
29+ if (member .getValue () instanceof JsonObject ) {
30+ obj .setNetClientOptions (new io .vertx .core .net .NetClientOptions ((io .vertx .core .json .JsonObject )member .getValue ()));
31+ }
32+ break ;
33+ case "endpoints" :
2934 if (member .getValue () instanceof JsonArray ) {
35+ java .util .ArrayList <java .lang .String > list = new java .util .ArrayList <>();
3036 ((Iterable <Object >)member .getValue ()).forEach ( item -> {
3137 if (item instanceof String )
32- obj . addConnectionString ((String )item );
38+ list . add ((String )item );
3339 });
40+ obj .setEndpoints (list );
3441 }
3542 break ;
3643 case "endpoint" :
3744 if (member .getValue () instanceof String ) {
3845 obj .setEndpoint ((String )member .getValue ());
3946 }
4047 break ;
41- case "endpoints " :
48+ case "connectionStrings " :
4249 if (member .getValue () instanceof JsonArray ) {
43- java .util .ArrayList <java .lang .String > list = new java .util .ArrayList <>();
4450 ((Iterable <Object >)member .getValue ()).forEach ( item -> {
4551 if (item instanceof String )
46- list . add ((String )item );
52+ obj . addConnectionString ((String )item );
4753 });
48- obj .setEndpoints (list );
4954 }
5055 break ;
51- case "masterName " :
56+ case "connectionString " :
5257 if (member .getValue () instanceof String ) {
53- obj .setMasterName ((String )member .getValue ());
58+ obj .setConnectionString ((String )member .getValue ());
5459 }
5560 break ;
56- case "maxNestedArrays " :
61+ case "maxWaitingHandlers " :
5762 if (member .getValue () instanceof Number ) {
58- obj .setMaxNestedArrays (((Number )member .getValue ()).intValue ());
63+ obj .setMaxWaitingHandlers (((Number )member .getValue ()).intValue ());
5964 }
6065 break ;
61- case "maxPoolSize " :
62- if (member .getValue () instanceof Number ) {
63- obj .setMaxPoolSize ((( Number )member .getValue ()). intValue ());
66+ case "masterName " :
67+ if (member .getValue () instanceof String ) {
68+ obj .setMasterName (( String )member .getValue ());
6469 }
6570 break ;
66- case "maxPoolWaiting " :
67- if (member .getValue () instanceof Number ) {
68- obj .setMaxPoolWaiting ((( Number )member .getValue ()). intValue ( ));
71+ case "role " :
72+ if (member .getValue () instanceof String ) {
73+ obj .setRole ( io . vertx . redis . client . RedisRole . valueOf (( String )member .getValue ()));
6974 }
7075 break ;
71- case "maxWaitingHandlers " :
72- if (member .getValue () instanceof Number ) {
73- obj .setMaxWaitingHandlers ((( Number )member .getValue ()). intValue ( ));
76+ case "useReplicas " :
77+ if (member .getValue () instanceof String ) {
78+ obj .setUseReplicas ( io . vertx . redis . client . RedisReplicas . valueOf (( String )member .getValue ()));
7479 }
7580 break ;
76- case "netClientOptions " :
77- if (member .getValue () instanceof JsonObject ) {
78- obj .setNetClientOptions ( new io . vertx . core . net . NetClientOptions (( io . vertx . core . json . JsonObject )member .getValue ()));
81+ case "maxNestedArrays " :
82+ if (member .getValue () instanceof Number ) {
83+ obj .setMaxNestedArrays ((( Number )member .getValue ()). intValue ( ));
7984 }
8085 break ;
81- case "password " :
86+ case "tracingPolicy " :
8287 if (member .getValue () instanceof String ) {
83- obj .setPassword (( String )member .getValue ());
88+ obj .setTracingPolicy ( io . vertx . core . tracing . TracingPolicy . valueOf (( String )member .getValue () ));
8489 }
8590 break ;
8691 case "poolCleanerInterval" :
8792 if (member .getValue () instanceof Number ) {
8893 obj .setPoolCleanerInterval (((Number )member .getValue ()).intValue ());
8994 }
9095 break ;
91- case "poolName" :
92- if (member .getValue () instanceof String ) {
93- obj .setPoolName ((String )member .getValue ());
94- }
95- break ;
96- case "poolRecycleTimeout" :
96+ case "maxPoolSize" :
9797 if (member .getValue () instanceof Number ) {
98- obj .setPoolRecycleTimeout (((Number )member .getValue ()).intValue ());
98+ obj .setMaxPoolSize (((Number )member .getValue ()).intValue ());
9999 }
100100 break ;
101- case "protocolNegotiation " :
102- if (member .getValue () instanceof Boolean ) {
103- obj .setProtocolNegotiation (( Boolean )member .getValue ());
101+ case "maxPoolWaiting " :
102+ if (member .getValue () instanceof Number ) {
103+ obj .setMaxPoolWaiting ((( Number )member .getValue ()). intValue ());
104104 }
105105 break ;
106- case "role " :
107- if (member .getValue () instanceof String ) {
108- obj .setRole ( io . vertx . redis . client . RedisRole . valueOf (( String )member .getValue ()));
106+ case "poolRecycleTimeout " :
107+ if (member .getValue () instanceof Number ) {
108+ obj .setPoolRecycleTimeout ((( Number )member .getValue ()). intValue ( ));
109109 }
110110 break ;
111- case "tracingPolicy " :
111+ case "password " :
112112 if (member .getValue () instanceof String ) {
113- obj .setTracingPolicy ( io . vertx . core . tracing . TracingPolicy . valueOf (( String )member .getValue () ));
113+ obj .setPassword (( String )member .getValue ());
114114 }
115115 break ;
116- case "type " :
117- if (member .getValue () instanceof String ) {
118- obj .setType ( io . vertx . redis . client . RedisClientType . valueOf (( String )member .getValue () ));
116+ case "protocolNegotiation " :
117+ if (member .getValue () instanceof Boolean ) {
118+ obj .setProtocolNegotiation (( Boolean )member .getValue ());
119119 }
120120 break ;
121- case "useReplicas " :
121+ case "poolName " :
122122 if (member .getValue () instanceof String ) {
123- obj .setUseReplicas ( io . vertx . redis . client . RedisReplicas . valueOf (( String )member .getValue () ));
123+ obj .setPoolName (( String )member .getValue ());
124124 }
125125 break ;
126126 }
@@ -132,44 +132,44 @@ public static void toJson(RedisOptions obj, JsonObject json) {
132132 }
133133
134134 public static void toJson (RedisOptions obj , java .util .Map <String , Object > json ) {
135- if (obj .getEndpoint () != null ) {
136- json .put ("endpoint" , obj .getEndpoint ());
135+ if (obj .getType () != null ) {
136+ json .put ("type" , obj .getType ().name ());
137+ }
138+ if (obj .getNetClientOptions () != null ) {
139+ json .put ("netClientOptions" , obj .getNetClientOptions ().toJson ());
137140 }
138141 if (obj .getEndpoints () != null ) {
139142 JsonArray array = new JsonArray ();
140143 obj .getEndpoints ().forEach (item -> array .add (item ));
141144 json .put ("endpoints" , array );
142145 }
146+ if (obj .getEndpoint () != null ) {
147+ json .put ("endpoint" , obj .getEndpoint ());
148+ }
149+ json .put ("maxWaitingHandlers" , obj .getMaxWaitingHandlers ());
143150 if (obj .getMasterName () != null ) {
144151 json .put ("masterName" , obj .getMasterName ());
145152 }
153+ if (obj .getRole () != null ) {
154+ json .put ("role" , obj .getRole ().name ());
155+ }
156+ if (obj .getUseReplicas () != null ) {
157+ json .put ("useReplicas" , obj .getUseReplicas ().name ());
158+ }
146159 json .put ("maxNestedArrays" , obj .getMaxNestedArrays ());
160+ if (obj .getTracingPolicy () != null ) {
161+ json .put ("tracingPolicy" , obj .getTracingPolicy ().name ());
162+ }
163+ json .put ("poolCleanerInterval" , obj .getPoolCleanerInterval ());
147164 json .put ("maxPoolSize" , obj .getMaxPoolSize ());
148165 json .put ("maxPoolWaiting" , obj .getMaxPoolWaiting ());
149- json .put ("maxWaitingHandlers" , obj .getMaxWaitingHandlers ());
150- if (obj .getNetClientOptions () != null ) {
151- json .put ("netClientOptions" , obj .getNetClientOptions ().toJson ());
152- }
166+ json .put ("poolRecycleTimeout" , obj .getPoolRecycleTimeout ());
153167 if (obj .getPassword () != null ) {
154168 json .put ("password" , obj .getPassword ());
155169 }
156- json .put ("poolCleanerInterval " , obj .getPoolCleanerInterval ());
170+ json .put ("protocolNegotiation " , obj .isProtocolNegotiation ());
157171 if (obj .getPoolName () != null ) {
158172 json .put ("poolName" , obj .getPoolName ());
159173 }
160- json .put ("poolRecycleTimeout" , obj .getPoolRecycleTimeout ());
161- json .put ("protocolNegotiation" , obj .isProtocolNegotiation ());
162- if (obj .getRole () != null ) {
163- json .put ("role" , obj .getRole ().name ());
164- }
165- if (obj .getTracingPolicy () != null ) {
166- json .put ("tracingPolicy" , obj .getTracingPolicy ().name ());
167- }
168- if (obj .getType () != null ) {
169- json .put ("type" , obj .getType ().name ());
170- }
171- if (obj .getUseReplicas () != null ) {
172- json .put ("useReplicas" , obj .getUseReplicas ().name ());
173- }
174174 }
175175}
0 commit comments