27
27
import java .util .ArrayList ;
28
28
import java .util .List ;
29
29
import java .util .Map ;
30
+ import java .util .Objects ;
30
31
import java .util .stream .Collectors ;
31
32
32
33
public class ServerPingRequest {
33
34
private static final Gson GSON = new GsonBuilder ().setFieldNamingPolicy (FieldNamingPolicy .LOWER_CASE_WITH_UNDERSCORES ).create ();
34
- private List <ClusterProfileProperties > allClusterProfilePropertiesProperties = new ArrayList <>();
35
+ private List <ClusterProfileProperties > allClusterProfileProperties = new ArrayList <>();
35
36
36
37
public ServerPingRequest () {
37
38
}
38
39
39
40
public ServerPingRequest (List <Map <String , String >> allClusterProfileProperties ) {
40
- this .allClusterProfilePropertiesProperties = allClusterProfileProperties .stream ()
41
- .map (clusterProfile -> ClusterProfileProperties . fromConfiguration ( clusterProfile ) )
41
+ this .allClusterProfileProperties = allClusterProfileProperties .stream ()
42
+ .map (ClusterProfileProperties :: fromConfiguration )
42
43
.collect (Collectors .toList ());
43
44
}
44
45
45
46
public List <ClusterProfileProperties > allClusterProfileProperties () {
46
- return allClusterProfilePropertiesProperties ;
47
+ return allClusterProfileProperties ;
47
48
}
48
49
49
50
public static ServerPingRequest fromJSON (String json ) {
@@ -53,10 +54,23 @@ public static ServerPingRequest fromJSON(String json) {
53
54
@ Override
54
55
public String toString () {
55
56
return "ServerPingRequest{" +
56
- "allClusterProfilePropertiesProperties =" + allClusterProfilePropertiesProperties +
57
+ "allClusterProfileProperties =" + allClusterProfileProperties +
57
58
'}' ;
58
59
}
59
60
61
+ @ Override
62
+ public boolean equals (Object o ) {
63
+ if (this == o ) return true ;
64
+ if (o == null || getClass () != o .getClass ()) return false ;
65
+ ServerPingRequest that = (ServerPingRequest ) o ;
66
+ return Objects .equals (allClusterProfileProperties , that .allClusterProfileProperties );
67
+ }
68
+
69
+ @ Override
70
+ public int hashCode () {
71
+ return Objects .hash (allClusterProfileProperties );
72
+ }
73
+
60
74
public ServerPingRequestExecutor executor (Map <String , DockerContainers > clusterSpecificAgentInstances , PluginRequest pluginRequest ) {
61
75
return new ServerPingRequestExecutor (this , clusterSpecificAgentInstances , pluginRequest );
62
76
}
0 commit comments