102c7dde6e848f3b3d831c43909aff72f0245307
[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 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         @Override
352         public String toString() {
353                 return "ComponentMetadataDataDefinition [uniqueId=" + uniqueId + ", name=" + name + ", version=" + version
354                                 + ", isHighestVersion=" + isHighestVersion + ", creationDate=" + creationDate + ", lastUpdateDate="
355                                 + lastUpdateDate + ", description=" + description + ", state=" + state + ", tags=" + tags
356                                 + ", conformanceLevel=" + conformanceLevel + ", icon=" + icon + ", UUID=" + UUID + ", normalizedName="
357                                 + normalizedName + ", systemName=" + systemName + ", contactId=" + contactId + ", allVersions="
358                                 + allVersions + ", isDeleted=" + isDeleted + ", projectCode=" + projectCode + ", csarUUID=" + csarUUID
359                                 + ", csarVersion=" + csarVersion + ", importedToscaChecksum=" + importedToscaChecksum
360                                 + ", invariantUUID=" + invariantUUID + ", componentType=" + componentType + ", creatorUserId="
361                                 + creatorUserId + ", creatorFullName=" + creatorFullName + ", lastUpdaterUserId=" + lastUpdaterUserId
362                                 + ", lastUpdaterFullName=" + lastUpdaterFullName + "]";
363         }
364
365         @Override
366         public int hashCode() {
367                 final int prime = 31;
368                 int result = 1;
369                 result = prime * result + ((UUID == null) ? 0 : UUID.hashCode());
370                 result = prime * result + ((allVersions == null) ? 0 : allVersions.hashCode());
371                 result = prime * result + ((componentType == null) ? 0 : componentType.hashCode());
372                 result = prime * result + ((conformanceLevel == null) ? 0 : conformanceLevel.hashCode());
373                 result = prime * result + ((contactId == null) ? 0 : contactId.hashCode());
374                 result = prime * result + ((creationDate == null) ? 0 : creationDate.hashCode());
375                 result = prime * result + ((creatorFullName == null) ? 0 : creatorFullName.hashCode());
376                 result = prime * result + ((creatorUserId == null) ? 0 : creatorUserId.hashCode());
377                 result = prime * result + ((csarUUID == null) ? 0 : csarUUID.hashCode());
378                 result = prime * result + ((csarVersion == null) ? 0 : csarVersion.hashCode());
379                 result = prime * result + ((description == null) ? 0 : description.hashCode());
380                 result = prime * result + ((icon == null) ? 0 : icon.hashCode());
381                 result = prime * result + ((importedToscaChecksum == null) ? 0 : importedToscaChecksum.hashCode());
382                 result = prime * result + ((invariantUUID == null) ? 0 : invariantUUID.hashCode());
383                 result = prime * result + ((isDeleted == null) ? 0 : isDeleted.hashCode());
384                 result = prime * result + ((isHighestVersion == null) ? 0 : isHighestVersion.hashCode());
385                 result = prime * result + ((lastUpdateDate == null) ? 0 : lastUpdateDate.hashCode());
386                 result = prime * result + ((lastUpdaterFullName == null) ? 0 : lastUpdaterFullName.hashCode());
387                 result = prime * result + ((lastUpdaterUserId == null) ? 0 : lastUpdaterUserId.hashCode());
388                 result = prime * result + ((name == null) ? 0 : name.hashCode());
389                 result = prime * result + ((normalizedName == null) ? 0 : normalizedName.hashCode());
390                 result = prime * result + ((projectCode == null) ? 0 : projectCode.hashCode());
391                 result = prime * result + ((state == null) ? 0 : state.hashCode());
392                 result = prime * result + ((systemName == null) ? 0 : systemName.hashCode());
393                 result = prime * result + ((tags == null) ? 0 : tags.hashCode());
394                 result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
395                 result = prime * result + ((version == null) ? 0 : version.hashCode());
396                 return result;
397         }
398
399         @Override
400         public boolean equals(Object obj) {
401                 if (this == obj)
402                         return true;
403                 if (obj == null)
404                         return false;
405                 if (getClass() != obj.getClass())
406                         return false;
407                 ComponentMetadataDataDefinition other = (ComponentMetadataDataDefinition) obj;
408                 if (UUID == null) {
409                         if (other.UUID != null)
410                                 return false;
411                 } else if (!UUID.equals(other.UUID))
412                         return false;
413                 if (allVersions == null) {
414                         if (other.allVersions != null)
415                                 return false;
416                 } else if (!allVersions.equals(other.allVersions))
417                         return false;
418                 if (componentType != other.componentType)
419                         return false;
420                 if (conformanceLevel == null) {
421                         if (other.conformanceLevel != null)
422                                 return false;
423                 } else if (!conformanceLevel.equals(other.conformanceLevel))
424                         return false;
425                 if (contactId == null) {
426                         if (other.contactId != null)
427                                 return false;
428                 } else if (!contactId.equals(other.contactId))
429                         return false;
430                 if (creationDate == null) {
431                         if (other.creationDate != null)
432                                 return false;
433                 } else if (!creationDate.equals(other.creationDate))
434                         return false;
435                 if (creatorFullName == null) {
436                         if (other.creatorFullName != null)
437                                 return false;
438                 } else if (!creatorFullName.equals(other.creatorFullName))
439                         return false;
440                 if (creatorUserId == null) {
441                         if (other.creatorUserId != null)
442                                 return false;
443                 } else if (!creatorUserId.equals(other.creatorUserId))
444                         return false;
445                 if (csarUUID == null) {
446                         if (other.csarUUID != null)
447                                 return false;
448                 } else if (!csarUUID.equals(other.csarUUID))
449                         return false;
450                 if (csarVersion == null) {
451                         if (other.csarVersion != null)
452                                 return false;
453                 } else if (!csarVersion.equals(other.csarVersion))
454                         return false;
455                 if (description == null) {
456                         if (other.description != null)
457                                 return false;
458                 } else if (!description.equals(other.description))
459                         return false;
460                 if (icon == null) {
461                         if (other.icon != null)
462                                 return false;
463                 } else if (!icon.equals(other.icon))
464                         return false;
465                 if (importedToscaChecksum == null) {
466                         if (other.importedToscaChecksum != null)
467                                 return false;
468                 } else if (!importedToscaChecksum.equals(other.importedToscaChecksum))
469                         return false;
470                 if (invariantUUID == null) {
471                         if (other.invariantUUID != null)
472                                 return false;
473                 } else if (!invariantUUID.equals(other.invariantUUID))
474                         return false;
475                 if (isDeleted == null) {
476                         if (other.isDeleted != null)
477                                 return false;
478                 } else if (!isDeleted.equals(other.isDeleted))
479                         return false;
480                 if (isHighestVersion == null) {
481                         if (other.isHighestVersion != null)
482                                 return false;
483                 } else if (!isHighestVersion.equals(other.isHighestVersion))
484                         return false;
485                 if (lastUpdateDate == null) {
486                         if (other.lastUpdateDate != null)
487                                 return false;
488                 } else if (!lastUpdateDate.equals(other.lastUpdateDate))
489                         return false;
490                 if (lastUpdaterFullName == null) {
491                         if (other.lastUpdaterFullName != null)
492                                 return false;
493                 } else if (!lastUpdaterFullName.equals(other.lastUpdaterFullName))
494                         return false;
495                 if (lastUpdaterUserId == null) {
496                         if (other.lastUpdaterUserId != null)
497                                 return false;
498                 } else if (!lastUpdaterUserId.equals(other.lastUpdaterUserId))
499                         return false;
500                 if (name == null) {
501                         if (other.name != null)
502                                 return false;
503                 } else if (!name.equals(other.name))
504                         return false;
505                 if (normalizedName == null) {
506                         if (other.normalizedName != null)
507                                 return false;
508                 } else if (!normalizedName.equals(other.normalizedName))
509                         return false;
510                 if (projectCode == null) {
511                         if (other.projectCode != null)
512                                 return false;
513                 } else if (!projectCode.equals(other.projectCode))
514                         return false;
515                 if (state == null) {
516                         if (other.state != null)
517                                 return false;
518                 } else if (!state.equals(other.state))
519                         return false;
520                 if (systemName == null) {
521                         if (other.systemName != null)
522                                 return false;
523                 } else if (!systemName.equals(other.systemName))
524                         return false;
525                 if (tags == null) {
526                         if (other.tags != null)
527                                 return false;
528                 } else if (!tags.equals(other.tags))
529                         return false;
530                 if (uniqueId == null) {
531                         if (other.uniqueId != null)
532                                 return false;
533                 } else if (!uniqueId.equals(other.uniqueId))
534                         return false;
535                 if (version == null) {
536                         if (other.version != null)
537                                 return false;
538                 } else if (!version.equals(other.version))
539                         return false;
540                 return true;
541         }
542
543 }