@@ -20,51 +20,51 @@ public class RedisConnectOptionsConverter {
20
20
public static void fromJson (Iterable <java .util .Map .Entry <String , Object >> json , RedisConnectOptions obj ) {
21
21
for (java .util .Map .Entry <String , Object > member : json ) {
22
22
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" :
24
34
if (member .getValue () instanceof String ) {
25
- obj .setConnectionString ((String )member .getValue ());
35
+ obj .setPassword ((String )member .getValue ());
26
36
}
27
37
break ;
28
- case "connectionStrings " :
38
+ case "endpoints " :
29
39
if (member .getValue () instanceof JsonArray ) {
40
+ java .util .ArrayList <java .lang .String > list = new java .util .ArrayList <>();
30
41
((Iterable <Object >)member .getValue ()).forEach ( item -> {
31
42
if (item instanceof String )
32
- obj . addConnectionString ((String )item );
43
+ list . add ((String )item );
33
44
});
45
+ obj .setEndpoints (list );
34
46
}
35
47
break ;
36
48
case "endpoint" :
37
49
break ;
38
- case "endpoints " :
50
+ case "connectionStrings " :
39
51
if (member .getValue () instanceof JsonArray ) {
40
- java .util .ArrayList <java .lang .String > list = new java .util .ArrayList <>();
41
52
((Iterable <Object >)member .getValue ()).forEach ( item -> {
42
53
if (item instanceof String )
43
- list . add ((String )item );
54
+ obj . addConnectionString ((String )item );
44
55
});
45
- obj .setEndpoints (list );
46
56
}
47
57
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 ());
51
61
}
52
62
break ;
53
63
case "maxWaitingHandlers" :
54
64
if (member .getValue () instanceof Number ) {
55
65
obj .setMaxWaitingHandlers (((Number )member .getValue ()).intValue ());
56
66
}
57
67
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 ;
68
68
}
69
69
}
70
70
}
@@ -74,19 +74,19 @@ public static void toJson(RedisConnectOptions obj, JsonObject json) {
74
74
}
75
75
76
76
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 ());
79
81
}
80
82
if (obj .getEndpoints () != null ) {
81
83
JsonArray array = new JsonArray ();
82
84
obj .getEndpoints ().forEach (item -> array .add (item ));
83
85
json .put ("endpoints" , array );
84
86
}
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 ());
89
89
}
90
- json .put ("protocolNegotiation " , obj .isProtocolNegotiation ());
90
+ json .put ("maxWaitingHandlers " , obj .getMaxWaitingHandlers ());
91
91
}
92
92
}
0 commit comments