forked from Netflix/eureka
-
Notifications
You must be signed in to change notification settings - Fork 178
/
ReplicationListResponse.java
51 lines (39 loc) · 1.5 KB
/
ReplicationListResponse.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.netflix.eureka.cluster.protocol;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.netflix.discovery.provider.Serializer;
/**
* The jersey resource class that generates the replication batch response.
*/
@Serializer("jackson") // For backwards compatibility with DiscoveryJerseyProvider
public class ReplicationListResponse {
private List<ReplicationInstanceResponse> responseList;
public ReplicationListResponse() {
this.responseList = new ArrayList<ReplicationInstanceResponse>();
}
@JsonCreator
public ReplicationListResponse(@JsonProperty("responseList") List<ReplicationInstanceResponse> responseList) {
this.responseList = responseList;
}
public List<ReplicationInstanceResponse> getResponseList() {
return responseList;
}
public void addResponse(ReplicationInstanceResponse singleResponse) {
responseList.add(singleResponse);
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ReplicationListResponse that = (ReplicationListResponse) o;
return !(responseList != null ? !responseList.equals(that.responseList) : that.responseList != null);
}
@Override
public int hashCode() {
return responseList != null ? responseList.hashCode() : 0;
}
}