2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.be.datatypes.components;
23 import java.io.Serializable;
24 import java.util.ArrayList;
25 import java.util.HashMap;
26 import java.util.List;
29 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
30 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
32 public abstract class ComponentMetadataDataDefinition extends ToscaDataDefinition implements Serializable {
37 private static final long serialVersionUID = -9114770126086263552L;
39 private String uniqueId;
41 private String name; // archiveName
43 private String version; // archiveVersion
45 private Boolean isHighestVersion;
47 private Long creationDate;
49 private Long lastUpdateDate;
51 private String description;
55 private List<String> tags;
57 private String conformanceLevel;
63 private String normalizedName;
65 private String systemName;
67 private String contactId;
69 private Map<String, String> allVersions;
71 private Boolean isDeleted;
73 private String projectCode;
75 private String csarUUID;
77 private String csarVersion;
79 private String importedToscaChecksum;
81 private String invariantUUID;
83 protected ComponentTypeEnum componentType;
86 private String creatorUserId;
88 private String creatorFullName;
90 private String lastUpdaterUserId;
92 private String lastUpdaterFullName;
94 public Boolean getIsHighestVersion() {
95 return isHighestVersion;
98 public void setIsHighestVersion(Boolean isHighestVersion) {
99 this.isHighestVersion = isHighestVersion;
102 public ComponentTypeEnum getComponentType() {
103 return componentType;
106 public void setComponentType(ComponentTypeEnum componentType) {
107 this.componentType = componentType;
110 public String getCreatorUserId() {
111 return creatorUserId;
114 public void setCreatorUserId(String creatorUserId) {
115 this.creatorUserId = creatorUserId;
118 public String getCreatorFullName() {
119 return creatorFullName;
122 public void setCreatorFullName(String creatorFullName) {
123 this.creatorFullName = creatorFullName;
126 public String getLastUpdaterUserId() {
127 return lastUpdaterUserId;
130 public void setLastUpdaterUserId(String lastUpdaterUserId) {
131 this.lastUpdaterUserId = lastUpdaterUserId;
134 public String getLastUpdaterFullName() {
135 return lastUpdaterFullName;
138 public void setLastUpdaterFullName(String lastUpdaterFullName) {
139 this.lastUpdaterFullName = lastUpdaterFullName;
142 public Boolean getIsDeleted() {
146 public ComponentMetadataDataDefinition() {
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();
175 public String getUniqueId() {
179 public void setUniqueId(String uniqueId) {
180 this.uniqueId = uniqueId;
183 public String getName() {
187 public void setName(String name) {
191 public String getVersion() {
195 public void setVersion(String version) {
196 this.version = version;
199 public Boolean isHighestVersion() {
200 return isHighestVersion;
203 public void setHighestVersion(Boolean isHighestVersion) {
204 this.isHighestVersion = isHighestVersion;
207 public Long getCreationDate() {
211 public void setCreationDate(Long creationDate) {
212 this.creationDate = creationDate;
215 public Long getLastUpdateDate() {
216 return lastUpdateDate;
219 public void setLastUpdateDate(Long lastUpdateDate) {
220 this.lastUpdateDate = lastUpdateDate;
223 public String getDescription() {
227 public void setDescription(String description) {
228 this.description = description;
231 public String getState() {
235 public void setState(String state) {
239 public List<String> getTags() {
243 public void setTags(List<String> tags) {
247 public String getIcon() {
251 public void setIcon(String icon) {
255 public String getContactId() {
259 public void setContactId(String contactId) {
260 this.contactId = contactId;
263 public String getUUID() {
267 public void setUUID(String uUID) {
271 public String getNormalizedName() {
272 return normalizedName;
275 public void setNormalizedName(String normalizedName) {
276 this.normalizedName = normalizedName;
279 public String getSystemName() {
283 public void setSystemName(String systemName) {
284 this.systemName = systemName;
287 public Map<String, String> getAllVersions() {
291 public void setAllVersions(Map<String, String> allVersions) {
292 this.allVersions = allVersions;
295 public String getInvariantUUID() {
296 return invariantUUID;
299 public void setInvariantUUID(String invariantUUID) {
300 this.invariantUUID = invariantUUID;
303 public Boolean isDeleted() {
307 public void setIsDeleted(Boolean isDeleted) {
308 this.isDeleted = isDeleted;
311 public String getProjectCode() {
315 public void setProjectCode(String projectCode) {
316 this.projectCode = projectCode;
319 public String getCsarUUID() {
323 public void setCsarUUID(String csarUUID) {
324 this.csarUUID = csarUUID;
327 public String getCsarVersion() {
331 public void setCsarVersion(String csarVersion) {
332 this.csarVersion = csarVersion;
335 public String getImportedToscaChecksum() {
336 return importedToscaChecksum;
339 public void setImportedToscaChecksum(String importedToscaChecksum) {
340 this.importedToscaChecksum = importedToscaChecksum;
343 public String getConformanceLevel() {
344 return conformanceLevel;
347 public void setConformanceLevel(String conformanceLevel) {
348 this.conformanceLevel = conformanceLevel;
351 public String getLifecycleState() {
355 public void setLifecycleState(String state) {
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 + "]";
374 public int hashCode() {
375 final int prime = 31;
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());
408 public boolean equals(Object obj) {
413 if (getClass() != obj.getClass())
415 ComponentMetadataDataDefinition other = (ComponentMetadataDataDefinition) obj;
417 if (other.UUID != null)
419 } else if (!UUID.equals(other.UUID))
421 if (allVersions == null) {
422 if (other.allVersions != null)
424 } else if (!allVersions.equals(other.allVersions))
426 if (componentType != other.componentType)
428 if (conformanceLevel == null) {
429 if (other.conformanceLevel != null)
431 } else if (!conformanceLevel.equals(other.conformanceLevel))
433 if (contactId == null) {
434 if (other.contactId != null)
436 } else if (!contactId.equals(other.contactId))
438 if (creationDate == null) {
439 if (other.creationDate != null)
441 } else if (!creationDate.equals(other.creationDate))
443 if (creatorFullName == null) {
444 if (other.creatorFullName != null)
446 } else if (!creatorFullName.equals(other.creatorFullName))
448 if (creatorUserId == null) {
449 if (other.creatorUserId != null)
451 } else if (!creatorUserId.equals(other.creatorUserId))
453 if (csarUUID == null) {
454 if (other.csarUUID != null)
456 } else if (!csarUUID.equals(other.csarUUID))
458 if (csarVersion == null) {
459 if (other.csarVersion != null)
461 } else if (!csarVersion.equals(other.csarVersion))
463 if (description == null) {
464 if (other.description != null)
466 } else if (!description.equals(other.description))
469 if (other.icon != null)
471 } else if (!icon.equals(other.icon))
473 if (importedToscaChecksum == null) {
474 if (other.importedToscaChecksum != null)
476 } else if (!importedToscaChecksum.equals(other.importedToscaChecksum))
478 if (invariantUUID == null) {
479 if (other.invariantUUID != null)
481 } else if (!invariantUUID.equals(other.invariantUUID))
483 if (isDeleted == null) {
484 if (other.isDeleted != null)
486 } else if (!isDeleted.equals(other.isDeleted))
488 if (isHighestVersion == null) {
489 if (other.isHighestVersion != null)
491 } else if (!isHighestVersion.equals(other.isHighestVersion))
493 if (lastUpdateDate == null) {
494 if (other.lastUpdateDate != null)
496 } else if (!lastUpdateDate.equals(other.lastUpdateDate))
498 if (lastUpdaterFullName == null) {
499 if (other.lastUpdaterFullName != null)
501 } else if (!lastUpdaterFullName.equals(other.lastUpdaterFullName))
503 if (lastUpdaterUserId == null) {
504 if (other.lastUpdaterUserId != null)
506 } else if (!lastUpdaterUserId.equals(other.lastUpdaterUserId))
509 if (other.name != null)
511 } else if (!name.equals(other.name))
513 if (normalizedName == null) {
514 if (other.normalizedName != null)
516 } else if (!normalizedName.equals(other.normalizedName))
518 if (projectCode == null) {
519 if (other.projectCode != null)
521 } else if (!projectCode.equals(other.projectCode))
524 if (other.state != null)
526 } else if (!state.equals(other.state))
528 if (systemName == null) {
529 if (other.systemName != null)
531 } else if (!systemName.equals(other.systemName))
534 if (other.tags != null)
536 } else if (!tags.equals(other.tags))
538 if (uniqueId == null) {
539 if (other.uniqueId != null)
541 } else if (!uniqueId.equals(other.uniqueId))
543 if (version == null) {
544 if (other.version != null)
546 } else if (!version.equals(other.version))