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;
25 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
26 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
28 public class ResourceMetadataDataDefinition extends ComponentMetadataDataDefinition implements Serializable {
33 private static final long serialVersionUID = 1142973528643758481L;
35 private String vendorName;
36 private String vendorRelease;
37 private ResourceTypeEnum resourceType = ResourceTypeEnum.VFC; // ResourceType.VFC
40 private Boolean isAbstract;
42 private String licenseType;
43 private String toscaResourceName;
45 public ResourceMetadataDataDefinition() {
49 public ResourceMetadataDataDefinition(ResourceMetadataDataDefinition other) {
51 this.vendorName = other.getVendorName();
52 this.vendorRelease = other.getVendorRelease();
53 this.isAbstract = other.isHighestVersion();
54 this.resourceType = other.getResourceType();
55 this.toscaResourceName = other.getToscaResourceName();
58 public String getVendorName() {
62 public void setVendorName(String vendorName) {
63 this.vendorName = vendorName;
66 public String getVendorRelease() {
70 public void setVendorRelease(String vendorRelease) {
71 this.vendorRelease = vendorRelease;
74 public ResourceTypeEnum getResourceType() {
78 public void setResourceType(ResourceTypeEnum resourceType) {
79 this.resourceType = resourceType;
82 public Boolean isAbstract() {
86 public void setAbstract(Boolean isAbstract) {
87 this.isAbstract = isAbstract;
90 public String getCost() {
94 public void setCost(String cost) {
98 public String getLicenseType() {
102 public void setLicenseType(String licenseType) {
103 this.licenseType = licenseType;
106 public String getToscaResourceName() {
107 return toscaResourceName;
110 public void setToscaResourceName(String toscaResourceName) {
111 this.toscaResourceName = toscaResourceName;
115 public String toString() {
116 return "ResourceMetadataDataDefinition [vendorName=" + vendorName + ", vendorRelease=" + vendorRelease
117 + ", resourceType=" + resourceType + ", isAbstract=" + isAbstract + super.toString() + "]";
121 public int hashCode() {
122 final int prime = 31;
123 int result = super.hashCode();
124 result = prime * result + ((cost == null) ? 0 : cost.hashCode());
125 result = prime * result + ((isAbstract == null) ? 0 : isAbstract.hashCode());
126 result = prime * result + ((licenseType == null) ? 0 : licenseType.hashCode());
127 result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode());
128 result = prime * result + ((vendorName == null) ? 0 : vendorName.hashCode());
129 result = prime * result + ((vendorRelease == null) ? 0 : vendorRelease.hashCode());
134 public boolean equals(Object obj) {
137 if (!super.equals(obj))
139 if (getClass() != obj.getClass())
141 ResourceMetadataDataDefinition other = (ResourceMetadataDataDefinition) obj;
143 if (other.cost != null)
145 } else if (!cost.equals(other.cost))
147 if (isAbstract == null) {
148 if (other.isAbstract != null)
150 } else if (!isAbstract.equals(other.isAbstract))
152 if (licenseType == null) {
153 if (other.licenseType != null)
155 } else if (!licenseType.equals(other.licenseType))
157 if (resourceType != other.resourceType)
159 if (vendorName == null) {
160 if (other.vendorName != null)
162 } else if (!vendorName.equals(other.vendorName))
164 if (vendorRelease == null) {
165 if (other.vendorRelease != null)
168 if (toscaResourceName == null) {
169 if (other.toscaResourceName != null)
171 } else if (!vendorRelease.equals(other.vendorRelease))
174 return super.equals(obj);