@@ -20,51 +20,51 @@ public class RedisConnectOptionsConverter {
2020 public static void fromJson (Iterable <java .util .Map .Entry <String , Object >> json , RedisConnectOptions obj ) {
2121 for (java .util .Map .Entry <String , Object > member : json ) {
2222 switch (member .getKey ()) {
23- case "connectionString" :
23+ case "maxNestedArrays" :
24+ if (member .getValue () instanceof Number ) {
25+ obj .setMaxNestedArrays (((Number )member .getValue ()).intValue ());
26+ }
27+ break ;
28+ case "protocolNegotiation" :
29+ if (member .getValue () instanceof Boolean ) {
30+ obj .setProtocolNegotiation ((Boolean )member .getValue ());
31+ }
32+ break ;
33+ case "password" :
2434 if (member .getValue () instanceof String ) {
25- obj .setConnectionString ((String )member .getValue ());
35+ obj .setPassword ((String )member .getValue ());
2636 }
2737 break ;
28- case "connectionStrings " :
38+ case "endpoints " :
2939 if (member .getValue () instanceof JsonArray ) {
40+ java .util .ArrayList <java .lang .String > list = new java .util .ArrayList <>();
3041 ((Iterable <Object >)member .getValue ()).forEach ( item -> {
3142 if (item instanceof String )
32- obj . addConnectionString ((String )item );
43+ list . add ((String )item );
3344 });
45+ obj .setEndpoints (list );
3446 }
3547 break ;
3648 case "endpoint" :
3749 break ;
38- case "endpoints " :
50+ case "connectionStrings " :
3951 if (member .getValue () instanceof JsonArray ) {
40- java .util .ArrayList <java .lang .String > list = new java .util .ArrayList <>();
4152 ((Iterable <Object >)member .getValue ()).forEach ( item -> {
4253 if (item instanceof String )
43- list . add ((String )item );
54+ obj . addConnectionString ((String )item );
4455 });
45- obj .setEndpoints (list );
4656 }
4757 break ;
48- case "maxNestedArrays " :
49- if (member .getValue () instanceof Number ) {
50- obj .setMaxNestedArrays ((( Number )member .getValue ()). intValue ());
58+ case "connectionString " :
59+ if (member .getValue () instanceof String ) {
60+ obj .setConnectionString (( String )member .getValue ());
5161 }
5262 break ;
5363 case "maxWaitingHandlers" :
5464 if (member .getValue () instanceof Number ) {
5565 obj .setMaxWaitingHandlers (((Number )member .getValue ()).intValue ());
5666 }
5767 break ;
58- case "password" :
59- if (member .getValue () instanceof String ) {
60- obj .setPassword ((String )member .getValue ());
61- }
62- break ;
63- case "protocolNegotiation" :
64- if (member .getValue () instanceof Boolean ) {
65- obj .setProtocolNegotiation ((Boolean )member .getValue ());
66- }
67- break ;
6868 }
6969 }
7070 }
@@ -74,19 +74,19 @@ public static void toJson(RedisConnectOptions obj, JsonObject json) {
7474 }
7575
7676 public static void toJson (RedisConnectOptions obj , java .util .Map <String , Object > json ) {
77- if (obj .getEndpoint () != null ) {
78- json .put ("endpoint" , obj .getEndpoint ());
77+ json .put ("maxNestedArrays" , obj .getMaxNestedArrays ());
78+ json .put ("protocolNegotiation" , obj .isProtocolNegotiation ());
79+ if (obj .getPassword () != null ) {
80+ json .put ("password" , obj .getPassword ());
7981 }
8082 if (obj .getEndpoints () != null ) {
8183 JsonArray array = new JsonArray ();
8284 obj .getEndpoints ().forEach (item -> array .add (item ));
8385 json .put ("endpoints" , array );
8486 }
85- json .put ("maxNestedArrays" , obj .getMaxNestedArrays ());
86- json .put ("maxWaitingHandlers" , obj .getMaxWaitingHandlers ());
87- if (obj .getPassword () != null ) {
88- json .put ("password" , obj .getPassword ());
87+ if (obj .getEndpoint () != null ) {
88+ json .put ("endpoint" , obj .getEndpoint ());
8989 }
90- json .put ("protocolNegotiation " , obj .isProtocolNegotiation ());
90+ json .put ("maxWaitingHandlers " , obj .getMaxWaitingHandlers ());
9191 }
9292}
0 commit comments