1
|
|
|
/** |
2
|
|
|
* |
3
|
|
|
*/ |
4
|
|
|
package unicon.matthews.entity; |
5
|
|
|
|
6
|
|
|
import java.io.Serializable; |
7
|
|
|
import java.time.LocalDateTime; |
8
|
|
|
|
9
|
|
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
10
|
|
|
import org.apache.commons.lang3.builder.ToStringStyle; |
11
|
|
|
import org.springframework.data.annotation.Id; |
12
|
|
|
import org.springframework.data.mongodb.core.mapping.Document; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @author ggilbert |
16
|
|
|
* |
17
|
|
|
*/ |
18
|
|
|
@Document |
19
|
|
|
public class DataSync implements Serializable { |
20
|
|
|
|
21
|
|
|
public enum DataSyncType { |
22
|
|
|
canvas |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
public enum DataSyncStatus { |
26
|
|
|
fully_completed |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
|
30
|
|
|
private static final long serialVersionUID = 1L; |
31
|
|
|
|
32
|
|
|
@Id private String id; |
33
|
|
|
private String orgId; |
34
|
|
|
private String tenantId; |
35
|
|
|
private LocalDateTime syncDateTime; |
|
|
|
|
36
|
|
|
private String syncType; |
37
|
|
|
private DataSyncStatus syncStatus; |
38
|
|
|
|
39
|
|
|
private DataSync() {} |
40
|
|
|
|
41
|
|
|
public String getId() { |
42
|
|
|
return id; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public String getOrgId() { |
46
|
|
|
return orgId; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public String getTenantId() { |
50
|
|
|
return tenantId; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public LocalDateTime getSyncDateTime() { |
54
|
|
|
return syncDateTime; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public String getSyncType() { |
58
|
|
|
return syncType; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public DataSyncStatus getSyncStatus() { |
62
|
|
|
return syncStatus; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
@Override |
66
|
|
|
public String toString() { |
67
|
|
|
return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
@Override |
71
|
|
|
public int hashCode() { |
72
|
|
|
final int prime = 31; |
73
|
|
|
int result = 1; |
74
|
|
|
result = prime * result + ((id == null) ? 0 : id.hashCode()); |
75
|
|
|
result = prime * result + ((orgId == null) ? 0 : orgId.hashCode()); |
76
|
|
|
result = prime * result + ((syncDateTime == null) ? 0 : syncDateTime.hashCode()); |
77
|
|
|
result = prime * result + ((syncStatus == null) ? 0 : syncStatus.hashCode()); |
78
|
|
|
result = prime * result + ((syncType == null) ? 0 : syncType.hashCode()); |
79
|
|
|
result = prime * result + ((tenantId == null) ? 0 : tenantId.hashCode()); |
80
|
|
|
return result; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
@Override |
84
|
|
|
public boolean equals(Object obj) { |
85
|
|
|
if (this == obj) |
86
|
|
|
return true; |
87
|
|
|
if (obj == null) |
88
|
|
|
return false; |
89
|
|
|
if (getClass() != obj.getClass()) |
90
|
|
|
return false; |
91
|
|
|
DataSync other = (DataSync) obj; |
92
|
|
|
if (id == null) { |
93
|
|
|
if (other.id != null) |
94
|
|
|
return false; |
95
|
|
|
} else if (!id.equals(other.id)) |
96
|
|
|
return false; |
97
|
|
|
if (orgId == null) { |
98
|
|
|
if (other.orgId != null) |
99
|
|
|
return false; |
100
|
|
|
} else if (!orgId.equals(other.orgId)) |
101
|
|
|
return false; |
102
|
|
|
if (syncDateTime == null) { |
103
|
|
|
if (other.syncDateTime != null) |
104
|
|
|
return false; |
105
|
|
|
} else if (!syncDateTime.equals(other.syncDateTime)) |
106
|
|
|
return false; |
107
|
|
|
if (syncStatus == null) { |
108
|
|
|
if (other.syncStatus != null) |
109
|
|
|
return false; |
110
|
|
|
} else if (!syncStatus.equals(other.syncStatus)) |
111
|
|
|
return false; |
112
|
|
|
if (syncType == null) { |
113
|
|
|
if (other.syncType != null) |
114
|
|
|
return false; |
115
|
|
|
} else if (!syncType.equals(other.syncType)) |
116
|
|
|
return false; |
117
|
|
|
if (tenantId == null) { |
118
|
|
|
if (other.tenantId != null) |
119
|
|
|
return false; |
120
|
|
|
} else if (!tenantId.equals(other.tenantId)) |
121
|
|
|
return false; |
122
|
|
|
return true; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
public static class Builder { |
126
|
|
|
private DataSync _dataSync = new DataSync(); |
127
|
|
|
|
128
|
|
|
public Builder withId(String id) { |
129
|
|
|
_dataSync.id = id; |
130
|
|
|
return this; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
public Builder withOrgId(String orgId) { |
134
|
|
|
_dataSync.orgId = orgId; |
135
|
|
|
return this; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
public Builder withTenantId(String tenantId) { |
139
|
|
|
_dataSync.tenantId = tenantId; |
140
|
|
|
return this; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
public Builder withSyncDateTime(LocalDateTime syncDateTime) { |
144
|
|
|
_dataSync.syncDateTime = syncDateTime; |
145
|
|
|
return this; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
public Builder withSyncType(String syncType) { |
149
|
|
|
_dataSync.syncType = syncType; |
150
|
|
|
return this; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
public Builder withSyncStatus(DataSyncStatus syncStatus) { |
154
|
|
|
_dataSync.syncStatus = syncStatus; |
155
|
|
|
return this; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
public DataSync build() { |
159
|
|
|
return _dataSync; |
160
|
|
|
} |
161
|
|
|
} |
162
|
|
|
} |
163
|
|
|
|