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 public abstract class ComponentMetadataDataDefinition implements Serializable {
34 private static final long serialVersionUID = -9114770126086263552L;
36 private String uniqueId;
38 private String name; // archiveName
40 private String version; // archiveVersion
42 private Boolean isHighestVersion;
44 private Long creationDate;
46 private Long lastUpdateDate;
48 private String description;
52 private List<String> tags;
58 private String normalizedName;
60 private String systemName;
62 private String contactId;
64 private Map<String, String> allVersions;
66 private Boolean isDeleted;
68 private String projectCode;
70 private String csarUUID;
72 private String csarVersion;
74 private String importedToscaChecksum;
76 private String invariantUUID;
78 public ComponentMetadataDataDefinition() {
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();
106 public String getUniqueId() {
110 public void setUniqueId(String uniqueId) {
111 this.uniqueId = uniqueId;
114 public String getName() {
118 public void setName(String name) {
122 public String getVersion() {
126 public void setVersion(String version) {
127 this.version = version;
130 public Boolean isHighestVersion() {
131 return isHighestVersion;
134 public void setHighestVersion(Boolean isHighestVersion) {
135 this.isHighestVersion = isHighestVersion;
138 public Long getCreationDate() {
142 public void setCreationDate(Long creationDate) {
143 this.creationDate = creationDate;
146 public Long getLastUpdateDate() {
147 return lastUpdateDate;
150 public void setLastUpdateDate(Long lastUpdateDate) {
151 this.lastUpdateDate = lastUpdateDate;
154 public String getDescription() {
158 public void setDescription(String description) {
159 this.description = description;
162 public String getState() {
166 public void setState(String state) {
170 public List<String> getTags() {
174 public void setTags(List<String> tags) {
178 public String getIcon() {
182 public void setIcon(String icon) {
186 public String getContactId() {
190 public void setContactId(String contactId) {
191 this.contactId = contactId;
194 public String getUUID() {
198 public void setUUID(String uUID) {
202 public String getNormalizedName() {
203 return normalizedName;
206 public void setNormalizedName(String normalizedName) {
207 this.normalizedName = normalizedName;
210 public String getSystemName() {
214 public void setSystemName(String systemName) {
215 this.systemName = systemName;
218 public Map<String, String> getAllVersions() {
222 public void setAllVersions(Map<String, String> allVersions) {
223 this.allVersions = allVersions;
226 public String getInvariantUUID() {
227 return invariantUUID;
230 public void setInvariantUUID(String invariantUUID) {
231 this.invariantUUID = invariantUUID;
234 public Boolean isDeleted() {
238 public void setIsDeleted(Boolean isDeleted) {
239 this.isDeleted = isDeleted;
242 public String getProjectCode() {
246 public void setProjectCode(String projectCode) {
247 this.projectCode = projectCode;
250 public String getCsarUUID() {
254 public void setCsarUUID(String csarUUID) {
255 this.csarUUID = csarUUID;
258 public String getCsarVersion() {
262 public void setCsarVersion(String csarVersion) {
263 this.csarVersion = csarVersion;
266 public String getImportedToscaChecksum() {
267 return importedToscaChecksum;
270 public void setImportedToscaChecksum(String importedToscaChecksum) {
271 this.importedToscaChecksum = importedToscaChecksum;
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 + "]";
286 public int hashCode() {
287 final int prime = 31;
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());
314 public boolean equals(Object obj) {
319 if (getClass() != obj.getClass())
321 ComponentMetadataDataDefinition other = (ComponentMetadataDataDefinition) obj;
323 if (other.UUID != null)
325 } else if (!UUID.equals(other.UUID))
327 if (allVersions == null) {
328 if (other.allVersions != null)
330 } else if (!allVersions.equals(other.allVersions))
332 if (contactId == null) {
333 if (other.contactId != null)
335 } else if (!contactId.equals(other.contactId))
337 if (creationDate == null) {
338 if (other.creationDate != null)
340 } else if (!creationDate.equals(other.creationDate))
342 if (description == null) {
343 if (other.description != null)
345 } else if (!description.equals(other.description))
348 if (other.icon != null)
350 } else if (!icon.equals(other.icon))
352 if (isDeleted == null) {
353 if (other.isDeleted != null)
355 } else if (!isDeleted.equals(other.isDeleted))
357 if (isHighestVersion == null) {
358 if (other.isHighestVersion != null)
360 } else if (!isHighestVersion.equals(other.isHighestVersion))
362 if (lastUpdateDate == null) {
363 if (other.lastUpdateDate != null)
365 } else if (!lastUpdateDate.equals(other.lastUpdateDate))
368 if (other.name != null)
370 } else if (!name.equals(other.name))
372 if (normalizedName == null) {
373 if (other.normalizedName != null)
375 } else if (!normalizedName.equals(other.normalizedName))
378 if (other.state != null)
380 } else if (!state.equals(other.state))
382 if (systemName == null) {
383 if (other.systemName != null)
385 } else if (!systemName.equals(other.systemName))
388 if (other.tags != null)
390 } else if (!tags.equals(other.tags))
392 if (uniqueId == null) {
393 if (other.uniqueId != null)
395 } else if (!uniqueId.equals(other.uniqueId))
397 if (version == null) {
398 if (other.version != null)
400 } else if (!version.equals(other.version))
402 if (projectCode == null) {
403 if (other.projectCode != null)
405 } else if (!projectCode.equals(other.projectCode))
407 if (csarUUID == null) {
408 if (other.csarUUID != null)
410 } else if (!csarUUID.equals(other.csarUUID))
412 if (csarVersion == null) {
413 if (other.csarVersion != null)
415 } else if (!csarVersion.equals(other.csarVersion))
417 if (importedToscaChecksum == null) {
418 if (other.importedToscaChecksum != null)
420 } else if (!importedToscaChecksum.equals(other.importedToscaChecksum))
422 if (invariantUUID == null) {
423 if (other.invariantUUID != null)
425 } else if (!invariantUUID.equals(other.invariantUUID))