4af7a279a3566f68782481fd851137c4d6212e3e
[sdc.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.datatypes.components;
22
23 import java.io.Serializable;
24 import java.util.ArrayList;
25 import java.util.HashMap;
26 import java.util.List;
27 import java.util.Map;
28
29 public abstract class ComponentMetadataDataDefinition implements Serializable {
30
31         /**
32          * 
33          */
34         private static final long serialVersionUID = -9114770126086263552L;
35
36         private String uniqueId;
37
38         private String name; // archiveName
39
40         private String version; // archiveVersion
41
42         private Boolean isHighestVersion;
43
44         private Long creationDate;
45
46         private Long lastUpdateDate;
47
48         private String description;
49
50         private String state;
51
52         private List<String> tags;
53
54         private String icon;
55
56         private String UUID;
57
58         private String normalizedName;
59
60         private String systemName;
61
62         private String contactId;
63
64         private Map<String, String> allVersions;
65
66         private Boolean isDeleted;
67
68         private String projectCode;
69
70         private String csarUUID;
71
72         private String csarVersion;
73
74         private String importedToscaChecksum;
75
76         private String invariantUUID;
77
78         public ComponentMetadataDataDefinition() {
79
80         }
81
82         public ComponentMetadataDataDefinition(ComponentMetadataDataDefinition other) {
83                 this.uniqueId = other.getUniqueId();
84                 this.name = other.getName();
85                 this.version = other.getVersion();
86                 this.isHighestVersion = other.isHighestVersion();
87                 this.creationDate = other.getCreationDate();
88                 this.lastUpdateDate = other.getLastUpdateDate();
89                 this.description = other.getDescription();
90                 this.state = other.getState();
91                 this.tags = new ArrayList<String>(other.getTags());
92                 this.icon = other.getIcon();
93                 this.contactId = other.getContactId();
94                 this.UUID = other.getUUID();
95                 this.normalizedName = other.getNormalizedName();
96                 this.systemName = other.getSystemName();
97                 this.allVersions = new HashMap<String, String>(other.getAllVersions());
98                 this.isDeleted = other.isDeleted();
99                 this.projectCode = other.getProjectCode();
100                 this.csarUUID = other.getCsarUUID();
101                 this.csarVersion = other.csarVersion;
102                 this.importedToscaChecksum = other.getImportedToscaChecksum();
103                 this.invariantUUID = other.getInvariantUUID();
104         }
105
106         public String getUniqueId() {
107                 return uniqueId;
108         }
109
110         public void setUniqueId(String uniqueId) {
111                 this.uniqueId = uniqueId;
112         }
113
114         public String getName() {
115                 return name;
116         }
117
118         public void setName(String name) {
119                 this.name = name;
120         }
121
122         public String getVersion() {
123                 return version;
124         }
125
126         public void setVersion(String version) {
127                 this.version = version;
128         }
129
130         public Boolean isHighestVersion() {
131                 return isHighestVersion;
132         }
133
134         public void setHighestVersion(Boolean isHighestVersion) {
135                 this.isHighestVersion = isHighestVersion;
136         }
137
138         public Long getCreationDate() {
139                 return creationDate;
140         }
141
142         public void setCreationDate(Long creationDate) {
143                 this.creationDate = creationDate;
144         }
145
146         public Long getLastUpdateDate() {
147                 return lastUpdateDate;
148         }
149
150         public void setLastUpdateDate(Long lastUpdateDate) {
151                 this.lastUpdateDate = lastUpdateDate;
152         }
153
154         public String getDescription() {
155                 return description;
156         }
157
158         public void setDescription(String description) {
159                 this.description = description;
160         }
161
162         public String getState() {
163                 return state;
164         }
165
166         public void setState(String state) {
167                 this.state = state;
168         }
169
170         public List<String> getTags() {
171                 return tags;
172         }
173
174         public void setTags(List<String> tags) {
175                 this.tags = tags;
176         }
177
178         public String getIcon() {
179                 return icon;
180         }
181
182         public void setIcon(String icon) {
183                 this.icon = icon;
184         }
185
186         public String getContactId() {
187                 return contactId;
188         }
189
190         public void setContactId(String contactId) {
191                 this.contactId = contactId;
192         }
193
194         public String getUUID() {
195                 return UUID;
196         }
197
198         public void setUUID(String uUID) {
199                 UUID = uUID;
200         }
201
202         public String getNormalizedName() {
203                 return normalizedName;
204         }
205
206         public void setNormalizedName(String normalizedName) {
207                 this.normalizedName = normalizedName;
208         }
209
210         public String getSystemName() {
211                 return systemName;
212         }
213
214         public void setSystemName(String systemName) {
215                 this.systemName = systemName;
216         }
217
218         public Map<String, String> getAllVersions() {
219                 return allVersions;
220         }
221
222         public void setAllVersions(Map<String, String> allVersions) {
223                 this.allVersions = allVersions;
224         }
225
226         public String getInvariantUUID() {
227                 return invariantUUID;
228         }
229
230         public void setInvariantUUID(String invariantUUID) {
231                 this.invariantUUID = invariantUUID;
232         }
233
234         public Boolean isDeleted() {
235                 return isDeleted;
236         }
237
238         public void setIsDeleted(Boolean isDeleted) {
239                 this.isDeleted = isDeleted;
240         }
241
242         public String getProjectCode() {
243                 return projectCode;
244         }
245
246         public void setProjectCode(String projectCode) {
247                 this.projectCode = projectCode;
248         }
249
250         public String getCsarUUID() {
251                 return csarUUID;
252         }
253
254         public void setCsarUUID(String csarUUID) {
255                 this.csarUUID = csarUUID;
256         }
257
258         public String getCsarVersion() {
259                 return csarVersion;
260         }
261
262         public void setCsarVersion(String csarVersion) {
263                 this.csarVersion = csarVersion;
264         }
265
266         public String getImportedToscaChecksum() {
267                 return importedToscaChecksum;
268         }
269
270         public void setImportedToscaChecksum(String importedToscaChecksum) {
271                 this.importedToscaChecksum = importedToscaChecksum;
272         }
273
274         @Override
275         public String toString() {
276                 return "ComponentMetadataDataDefinition [uniqueId=" + uniqueId + ", name=" + name + ", version=" + version
277                                 + ", isHighestVersion=" + isHighestVersion + ", creationDate=" + creationDate + ", lastUpdateDate="
278                                 + lastUpdateDate + ", description=" + description + ", state=" + state + ", tags=" + tags + ", icon="
279                                 + icon + ", UUID=" + UUID + ", normalizedName=" + normalizedName + ", systemName=" + systemName
280                                 + ", contactId=" + contactId + ", allVersions=" + allVersions + ", isDeleted=" + isDeleted
281                                 + ", projectCode=" + projectCode + ", csarUUID=" + csarUUID + ", csarversion=" + csarVersion
282                                 + ", importedToscaChecksum=" + importedToscaChecksum + ", invariantUUID=" + invariantUUID + "]";
283         }
284
285         @Override
286         public int hashCode() {
287                 final int prime = 31;
288                 int result = 1;
289                 result = prime * result + ((UUID == null) ? 0 : UUID.hashCode());
290                 result = prime * result + ((allVersions == null) ? 0 : allVersions.hashCode());
291                 result = prime * result + ((contactId == null) ? 0 : contactId.hashCode());
292                 result = prime * result + ((creationDate == null) ? 0 : creationDate.hashCode());
293                 result = prime * result + ((description == null) ? 0 : description.hashCode());
294                 result = prime * result + ((icon == null) ? 0 : icon.hashCode());
295                 result = prime * result + ((isDeleted == null) ? 0 : isDeleted.hashCode());
296                 result = prime * result + ((isHighestVersion == null) ? 0 : isHighestVersion.hashCode());
297                 result = prime * result + ((lastUpdateDate == null) ? 0 : lastUpdateDate.hashCode());
298                 result = prime * result + ((name == null) ? 0 : name.hashCode());
299                 result = prime * result + ((normalizedName == null) ? 0 : normalizedName.hashCode());
300                 result = prime * result + ((state == null) ? 0 : state.hashCode());
301                 result = prime * result + ((systemName == null) ? 0 : systemName.hashCode());
302                 result = prime * result + ((tags == null) ? 0 : tags.hashCode());
303                 result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
304                 result = prime * result + ((version == null) ? 0 : version.hashCode());
305                 result = prime * result + ((projectCode == null) ? 0 : projectCode.hashCode());
306                 result = prime * result + ((csarUUID == null) ? 0 : csarUUID.hashCode());
307                 result = prime * result + ((csarVersion == null) ? 0 : csarVersion.hashCode());
308                 result = prime * result + ((importedToscaChecksum == null) ? 0 : importedToscaChecksum.hashCode());
309                 result = prime * result + ((invariantUUID == null) ? 0 : invariantUUID.hashCode());
310                 return result;
311         }
312
313         @Override
314         public boolean equals(Object obj) {
315                 if (this == obj)
316                         return true;
317                 if (obj == null)
318                         return false;
319                 if (getClass() != obj.getClass())
320                         return false;
321                 ComponentMetadataDataDefinition other = (ComponentMetadataDataDefinition) obj;
322                 if (UUID == null) {
323                         if (other.UUID != null)
324                                 return false;
325                 } else if (!UUID.equals(other.UUID))
326                         return false;
327                 if (allVersions == null) {
328                         if (other.allVersions != null)
329                                 return false;
330                 } else if (!allVersions.equals(other.allVersions))
331                         return false;
332                 if (contactId == null) {
333                         if (other.contactId != null)
334                                 return false;
335                 } else if (!contactId.equals(other.contactId))
336                         return false;
337                 if (creationDate == null) {
338                         if (other.creationDate != null)
339                                 return false;
340                 } else if (!creationDate.equals(other.creationDate))
341                         return false;
342                 if (description == null) {
343                         if (other.description != null)
344                                 return false;
345                 } else if (!description.equals(other.description))
346                         return false;
347                 if (icon == null) {
348                         if (other.icon != null)
349                                 return false;
350                 } else if (!icon.equals(other.icon))
351                         return false;
352                 if (isDeleted == null) {
353                         if (other.isDeleted != null)
354                                 return false;
355                 } else if (!isDeleted.equals(other.isDeleted))
356                         return false;
357                 if (isHighestVersion == null) {
358                         if (other.isHighestVersion != null)
359                                 return false;
360                 } else if (!isHighestVersion.equals(other.isHighestVersion))
361                         return false;
362                 if (lastUpdateDate == null) {
363                         if (other.lastUpdateDate != null)
364                                 return false;
365                 } else if (!lastUpdateDate.equals(other.lastUpdateDate))
366                         return false;
367                 if (name == null) {
368                         if (other.name != null)
369                                 return false;
370                 } else if (!name.equals(other.name))
371                         return false;
372                 if (normalizedName == null) {
373                         if (other.normalizedName != null)
374                                 return false;
375                 } else if (!normalizedName.equals(other.normalizedName))
376                         return false;
377                 if (state == null) {
378                         if (other.state != null)
379                                 return false;
380                 } else if (!state.equals(other.state))
381                         return false;
382                 if (systemName == null) {
383                         if (other.systemName != null)
384                                 return false;
385                 } else if (!systemName.equals(other.systemName))
386                         return false;
387                 if (tags == null) {
388                         if (other.tags != null)
389                                 return false;
390                 } else if (!tags.equals(other.tags))
391                         return false;
392                 if (uniqueId == null) {
393                         if (other.uniqueId != null)
394                                 return false;
395                 } else if (!uniqueId.equals(other.uniqueId))
396                         return false;
397                 if (version == null) {
398                         if (other.version != null)
399                                 return false;
400                 } else if (!version.equals(other.version))
401                         return false;
402                 if (projectCode == null) {
403                         if (other.projectCode != null)
404                                 return false;
405                 } else if (!projectCode.equals(other.projectCode))
406                         return false;
407                 if (csarUUID == null) {
408                         if (other.csarUUID != null)
409                                 return false;
410                 } else if (!csarUUID.equals(other.csarUUID))
411                         return false;
412                 if (csarVersion == null) {
413                         if (other.csarVersion != null)
414                                 return false;
415                 } else if (!csarVersion.equals(other.csarVersion))
416                         return false;
417                 if (importedToscaChecksum == null) {
418                         if (other.importedToscaChecksum != null)
419                                 return false;
420                 } else if (!importedToscaChecksum.equals(other.importedToscaChecksum))
421                         return false;
422                 if (invariantUUID == null) {
423                         if (other.invariantUUID != null)
424                                 return false;
425                 } else if (!invariantUUID.equals(other.invariantUUID))
426                         return false;
427                 return true;
428         }
429 }