[SDC-29] rebase continue work to align source
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / components / ComponentMetadataDataDefinition.java
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 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
30 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
31
32 public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinition implements Serializable {
33
34         /**
35          * 
36          */
37         private static final long serialVersionUID = -9114770126086263552L;
38
39         private String uniqueId;
40
41         private String name; // archiveName
42
43         private String version; // archiveVersion
44
45         private Boolean isHighestVersion;
46
47         private Long creationDate;
48
49         private Long lastUpdateDate;
50
51         private String description;
52
53         private String state;
54
55         private List<String> tags;
56
57         private String conformanceLevel;
58
59         private String icon;
60
61         private String UUID;
62
63         private String normalizedName;
64
65         private String systemName;
66
67         private String contactId;
68
69         private Map<String, String> allVersions;
70
71         private Boolean isDeleted;
72
73         private String projectCode;
74
75         private String csarUUID;
76
77         private String csarVersion;
78
79         private String importedToscaChecksum;
80
81         private String invariantUUID;
82
83         protected ComponentTypeEnum componentType;
84
85         // USER
86         private String creatorUserId;
87
88         private String creatorFullName;
89
90         private String lastUpdaterUserId;
91
92         private String lastUpdaterFullName;
93
94         public Boolean getIsHighestVersion() {
95                 return isHighestVersion;
96         }
97
98         public void setIsHighestVersion(Boolean isHighestVersion) {
99                 this.isHighestVersion = isHighestVersion;
100         }
101
102         public ComponentTypeEnum getComponentType() {
103                 return componentType;
104         }
105
106         public void setComponentType(ComponentTypeEnum componentType) {
107                 this.componentType = componentType;
108         }
109
110         public String getCreatorUserId() {
111                 return creatorUserId;
112         }
113
114         public void setCreatorUserId(String creatorUserId) {
115                 this.creatorUserId = creatorUserId;
116         }
117
118         public String getCreatorFullName() {
119                 return creatorFullName;
120         }
121
122         public void setCreatorFullName(String creatorFullName) {
123                 this.creatorFullName = creatorFullName;
124         }
125
126         public String getLastUpdaterUserId() {
127                 return lastUpdaterUserId;
128         }
129
130         public void setLastUpdaterUserId(String lastUpdaterUserId) {
131                 this.lastUpdaterUserId = lastUpdaterUserId;
132         }
133
134         public String getLastUpdaterFullName() {
135                 return lastUpdaterFullName;
136         }
137
138         public void setLastUpdaterFullName(String lastUpdaterFullName) {
139                 this.lastUpdaterFullName = lastUpdaterFullName;
140         }
141
142         public Boolean getIsDeleted() {
143                 return isDeleted;
144         }
145
146         public ComponentMetadataDataDefinition() {
147
148         }
149
150         public ComponentMetadataDataDefinition(ComponentMetadataDataDefinition other) {
151                 this.uniqueId = other.getUniqueId();
152                 this.name = other.getName();
153                 this.version = other.getVersion();
154                 this.isHighestVersion = other.isHighestVersion();
155                 this.creationDate = other.getCreationDate();
156                 this.lastUpdateDate = other.getLastUpdateDate();
157                 this.description = other.getDescription();
158                 this.state = other.getState();
159                 this.tags = new ArrayList<String>(other.getTags());
160                 this.icon = other.getIcon();
161                 this.contactId = other.getContactId();
162                 this.UUID = other.getUUID();
163                 this.normalizedName = other.getNormalizedName();
164                 this.systemName = other.getSystemName();
165                 this.allVersions = new HashMap<String, String>(other.getAllVersions());
166                 this.isDeleted = other.isDeleted();
167                 this.projectCode = other.getProjectCode();
168                 this.csarUUID = other.getCsarUUID();
169                 this.csarVersion = other.csarVersion;
170                 this.importedToscaChecksum = other.getImportedToscaChecksum();
171                 this.invariantUUID = other.getInvariantUUID();
172
173         }
174
175         public String getUniqueId() {
176                 return uniqueId;
177         }
178
179         public void setUniqueId(String uniqueId) {
180                 this.uniqueId = uniqueId;
181         }
182
183         public String getName() {
184                 return name;
185         }
186
187         public void setName(String name) {
188                 this.name = name;
189         }
190
191         public String getVersion() {
192                 return version;
193         }
194
195         public void setVersion(String version) {
196                 this.version = version;
197         }
198
199         public Boolean isHighestVersion() {
200                 return isHighestVersion;
201         }
202
203         public void setHighestVersion(Boolean isHighestVersion) {
204                 this.isHighestVersion = isHighestVersion;
205         }
206
207         public Long getCreationDate() {
208                 return creationDate;
209         }
210
211         public void setCreationDate(Long creationDate) {
212                 this.creationDate = creationDate;
213         }
214
215         public Long getLastUpdateDate() {
216                 return lastUpdateDate;
217         }
218
219         public void setLastUpdateDate(Long lastUpdateDate) {
220                 this.lastUpdateDate = lastUpdateDate;
221         }
222
223         public String getDescription() {
224                 return description;
225         }
226
227         public void setDescription(String description) {
228                 this.description = description;
229         }
230
231         public String getState() {
232                 return state;
233         }
234
235         public void setState(String state) {
236                 this.state = state;
237         }
238
239         public List<String> getTags() {
240                 return tags;
241         }
242
243         public void setTags(List<String> tags) {
244                 this.tags = tags;
245         }
246
247         public String getIcon() {
248                 return icon;
249         }
250
251         public void setIcon(String icon) {
252                 this.icon = icon;
253         }
254
255         public String getContactId() {
256                 return contactId;
257         }
258
259         public void setContactId(String contactId) {
260                 this.contactId = contactId;
261         }
262
263         public String getUUID() {
264                 return UUID;
265         }
266
267         public void setUUID(String uUID) {
268                 UUID = uUID;
269         }
270
271         public String getNormalizedName() {
272                 return normalizedName;
273         }
274
275         public void setNormalizedName(String normalizedName) {
276                 this.normalizedName = normalizedName;
277         }
278
279         public String getSystemName() {
280                 return systemName;
281         }
282
283         public void setSystemName(String systemName) {
284                 this.systemName = systemName;
285         }
286
287         public Map<String, String> getAllVersions() {
288                 return allVersions;
289         }
290
291         public void setAllVersions(Map<String, String> allVersions) {
292                 this.allVersions = allVersions;
293         }
294
295         public String getInvariantUUID() {
296                 return invariantUUID;
297         }
298
299         public void setInvariantUUID(String invariantUUID) {
300                 this.invariantUUID = invariantUUID;
301         }
302
303         public Boolean isDeleted() {
304                 return isDeleted;
305         }
306
307         public void setIsDeleted(Boolean isDeleted) {
308                 this.isDeleted = isDeleted;
309         }
310
311         public String getProjectCode() {
312                 return projectCode;
313         }
314
315         public void setProjectCode(String projectCode) {
316                 this.projectCode = projectCode;
317         }
318
319         public String getCsarUUID() {
320                 return csarUUID;
321         }
322
323         public void setCsarUUID(String csarUUID) {
324                 this.csarUUID = csarUUID;
325         }
326
327         public String getCsarVersion() {
328                 return csarVersion;
329         }
330
331         public void setCsarVersion(String csarVersion) {
332                 this.csarVersion = csarVersion;
333         }
334
335         public String getImportedToscaChecksum() {
336                 return importedToscaChecksum;
337         }
338
339         public void setImportedToscaChecksum(String importedToscaChecksum) {
340                 this.importedToscaChecksum = importedToscaChecksum;
341         }
342         
343         public String getConformanceLevel() {
344                 return conformanceLevel;
345         }
346
347         public void setConformanceLevel(String conformanceLevel) {
348                 this.conformanceLevel = conformanceLevel;
349         }
350
351         public String getLifecycleState() {
352                 return state;
353         }
354
355         public void setLifecycleState(String state) {
356                 this.state = state;
357         }
358         
359         @Override
360         public String toString() {
361                 return "ComponentMetadataDataDefinition [uniqueId=" + uniqueId + ", name=" + name + ", version=" + version
362                                 + ", isHighestVersion=" + isHighestVersion + ", creationDate=" + creationDate + ", lastUpdateDate="
363                                 + lastUpdateDate + ", description=" + description + ", state=" + state + ", tags=" + tags
364                                 + ", conformanceLevel=" + conformanceLevel + ", icon=" + icon + ", UUID=" + UUID + ", normalizedName="
365                                 + normalizedName + ", systemName=" + systemName + ", contactId=" + contactId + ", allVersions="
366                                 + allVersions + ", isDeleted=" + isDeleted + ", projectCode=" + projectCode + ", csarUUID=" + csarUUID
367                                 + ", csarVersion=" + csarVersion + ", importedToscaChecksum=" + importedToscaChecksum
368                                 + ", invariantUUID=" + invariantUUID + ", componentType=" + componentType + ", creatorUserId="
369                                 + creatorUserId + ", creatorFullName=" + creatorFullName + ", lastUpdaterUserId=" + lastUpdaterUserId
370                                 + ", lastUpdaterFullName=" + lastUpdaterFullName + "]";
371         }
372
373         @Override
374         public int hashCode() {
375                 final int prime = 31;
376                 int result = 1;
377                 result = prime * result + ((UUID == null) ? 0 : UUID.hashCode());
378                 result = prime * result + ((allVersions == null) ? 0 : allVersions.hashCode());
379                 result = prime * result + ((componentType == null) ? 0 : componentType.hashCode());
380                 result = prime * result + ((conformanceLevel == null) ? 0 : conformanceLevel.hashCode());
381                 result = prime * result + ((contactId == null) ? 0 : contactId.hashCode());
382                 result = prime * result + ((creationDate == null) ? 0 : creationDate.hashCode());
383                 result = prime * result + ((creatorFullName == null) ? 0 : creatorFullName.hashCode());
384                 result = prime * result + ((creatorUserId == null) ? 0 : creatorUserId.hashCode());
385                 result = prime * result + ((csarUUID == null) ? 0 : csarUUID.hashCode());
386                 result = prime * result + ((csarVersion == null) ? 0 : csarVersion.hashCode());
387                 result = prime * result + ((description == null) ? 0 : description.hashCode());
388                 result = prime * result + ((icon == null) ? 0 : icon.hashCode());
389                 result = prime * result + ((importedToscaChecksum == null) ? 0 : importedToscaChecksum.hashCode());
390                 result = prime * result + ((invariantUUID == null) ? 0 : invariantUUID.hashCode());
391                 result = prime * result + ((isDeleted == null) ? 0 : isDeleted.hashCode());
392                 result = prime * result + ((isHighestVersion == null) ? 0 : isHighestVersion.hashCode());
393                 result = prime * result + ((lastUpdateDate == null) ? 0 : lastUpdateDate.hashCode());
394                 result = prime * result + ((lastUpdaterFullName == null) ? 0 : lastUpdaterFullName.hashCode());
395                 result = prime * result + ((lastUpdaterUserId == null) ? 0 : lastUpdaterUserId.hashCode());
396                 result = prime * result + ((name == null) ? 0 : name.hashCode());
397                 result = prime * result + ((normalizedName == null) ? 0 : normalizedName.hashCode());
398                 result = prime * result + ((projectCode == null) ? 0 : projectCode.hashCode());
399                 result = prime * result + ((state == null) ? 0 : state.hashCode());
400                 result = prime * result + ((systemName == null) ? 0 : systemName.hashCode());
401                 result = prime * result + ((tags == null) ? 0 : tags.hashCode());
402                 result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
403                 result = prime * result + ((version == null) ? 0 : version.hashCode());
404                 return result;
405         }
406
407         @Override
408         public boolean equals(Object obj) {
409                 if (this == obj)
410                         return true;
411                 if (obj == null)
412                         return false;
413                 if (getClass() != obj.getClass())
414                         return false;
415                 ComponentMetadataDataDefinition other = (ComponentMetadataDataDefinition) obj;
416                 if (UUID == null) {
417                         if (other.UUID != null)
418                                 return false;
419                 } else if (!UUID.equals(other.UUID))
420                         return false;
421                 if (allVersions == null) {
422                         if (other.allVersions != null)
423                                 return false;
424                 } else if (!allVersions.equals(other.allVersions))
425                         return false;
426                 if (componentType != other.componentType)
427                         return false;
428                 if (conformanceLevel == null) {
429                         if (other.conformanceLevel != null)
430                                 return false;
431                 } else if (!conformanceLevel.equals(other.conformanceLevel))
432                         return false;
433                 if (contactId == null) {
434                         if (other.contactId != null)
435                                 return false;
436                 } else if (!contactId.equals(other.contactId))
437                         return false;
438                 if (creationDate == null) {
439                         if (other.creationDate != null)
440                                 return false;
441                 } else if (!creationDate.equals(other.creationDate))
442                         return false;
443                 if (creatorFullName == null) {
444                         if (other.creatorFullName != null)
445                                 return false;
446                 } else if (!creatorFullName.equals(other.creatorFullName))
447                         return false;
448                 if (creatorUserId == null) {
449                         if (other.creatorUserId != null)
450                                 return false;
451                 } else if (!creatorUserId.equals(other.creatorUserId))
452                         return false;
453                 if (csarUUID == null) {
454                         if (other.csarUUID != null)
455                                 return false;
456                 } else if (!csarUUID.equals(other.csarUUID))
457                         return false;
458                 if (csarVersion == null) {
459                         if (other.csarVersion != null)
460                                 return false;
461                 } else if (!csarVersion.equals(other.csarVersion))
462                         return false;
463                 if (description == null) {
464                         if (other.description != null)
465                                 return false;
466                 } else if (!description.equals(other.description))
467                         return false;
468                 if (icon == null) {
469                         if (other.icon != null)
470                                 return false;
471                 } else if (!icon.equals(other.icon))
472                         return false;
473                 if (importedToscaChecksum == null) {
474                         if (other.importedToscaChecksum != null)
475                                 return false;
476                 } else if (!importedToscaChecksum.equals(other.importedToscaChecksum))
477                         return false;
478                 if (invariantUUID == null) {
479                         if (other.invariantUUID != null)
480                                 return false;
481                 } else if (!invariantUUID.equals(other.invariantUUID))
482                         return false;
483                 if (isDeleted == null) {
484                         if (other.isDeleted != null)
485                                 return false;
486                 } else if (!isDeleted.equals(other.isDeleted))
487                         return false;
488                 if (isHighestVersion == null) {
489                         if (other.isHighestVersion != null)
490                                 return false;
491                 } else if (!isHighestVersion.equals(other.isHighestVersion))
492                         return false;
493                 if (lastUpdateDate == null) {
494                         if (other.lastUpdateDate != null)
495                                 return false;
496                 } else if (!lastUpdateDate.equals(other.lastUpdateDate))
497                         return false;
498                 if (lastUpdaterFullName == null) {
499                         if (other.lastUpdaterFullName != null)
500                                 return false;
501                 } else if (!lastUpdaterFullName.equals(other.lastUpdaterFullName))
502                         return false;
503                 if (lastUpdaterUserId == null) {
504                         if (other.lastUpdaterUserId != null)
505                                 return false;
506                 } else if (!lastUpdaterUserId.equals(other.lastUpdaterUserId))
507                         return false;
508                 if (name == null) {
509                         if (other.name != null)
510                                 return false;
511                 } else if (!name.equals(other.name))
512                         return false;
513                 if (normalizedName == null) {
514                         if (other.normalizedName != null)
515                                 return false;
516                 } else if (!normalizedName.equals(other.normalizedName))
517                         return false;
518                 if (projectCode == null) {
519                         if (other.projectCode != null)
520                                 return false;
521                 } else if (!projectCode.equals(other.projectCode))
522                         return false;
523                 if (state == null) {
524                         if (other.state != null)
525                                 return false;
526                 } else if (!state.equals(other.state))
527                         return false;
528                 if (systemName == null) {
529                         if (other.systemName != null)
530                                 return false;
531                 } else if (!systemName.equals(other.systemName))
532                         return false;
533                 if (tags == null) {
534                         if (other.tags != null)
535                                 return false;
536                 } else if (!tags.equals(other.tags))
537                         return false;
538                 if (uniqueId == null) {
539                         if (other.uniqueId != null)
540                                 return false;
541                 } else if (!uniqueId.equals(other.uniqueId))
542                         return false;
543                 if (version == null) {
544                         if (other.version != null)
545                                 return false;
546                 } else if (!version.equals(other.version))
547                         return false;
548                 return true;
549         }
550
551 }