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;
27 public class ResourceMetadataDataDefinition extends ComponentMetadataDataDefinition implements Serializable {
32 private static final long serialVersionUID = 1142973528643758481L;
34 private String vendorName;
35 private String vendorRelease;
36 private ResourceTypeEnum resourceType = ResourceTypeEnum.VFC; // ResourceType.VFC
39 private Boolean isAbstract;
41 private String licenseType;
42 private String toscaResourceName;
44 public ResourceMetadataDataDefinition() {
48 public ResourceMetadataDataDefinition(ResourceMetadataDataDefinition other) {
50 this.vendorName = other.getVendorName();
51 this.vendorRelease = other.getVendorRelease();
52 this.isAbstract = other.isHighestVersion();
53 this.resourceType = other.getResourceType();
54 this.toscaResourceName = other.getToscaResourceName();
57 public String getVendorName() {
61 public void setVendorName(String vendorName) {
62 this.vendorName = vendorName;
65 public String getVendorRelease() {
69 public void setVendorRelease(String vendorRelease) {
70 this.vendorRelease = vendorRelease;
73 public ResourceTypeEnum getResourceType() {
77 public void setResourceType(ResourceTypeEnum resourceType) {
78 this.resourceType = resourceType;
81 public Boolean isAbstract() {
85 public void setAbstract(Boolean isAbstract) {
86 this.isAbstract = isAbstract;
89 public String getCost() {
93 public void setCost(String cost) {
97 public String getLicenseType() {
101 public void setLicenseType(String licenseType) {
102 this.licenseType = licenseType;
105 public String getToscaResourceName() {
106 return toscaResourceName;
109 public void setToscaResourceName(String toscaResourceName) {
110 this.toscaResourceName = toscaResourceName;
114 public String toString() {
115 return "ResourceMetadataDataDefinition [vendorName=" + vendorName + ", vendorRelease=" + vendorRelease
116 + ", resourceType=" + resourceType + ", isAbstract=" + isAbstract + super.toString() + "]";
120 public int hashCode() {
121 final int prime = 31;
122 int result = super.hashCode();
123 result = prime * result + ((cost == null) ? 0 : cost.hashCode());
124 result = prime * result + ((isAbstract == null) ? 0 : isAbstract.hashCode());
125 result = prime * result + ((licenseType == null) ? 0 : licenseType.hashCode());
126 result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode());
127 result = prime * result + ((vendorName == null) ? 0 : vendorName.hashCode());
128 result = prime * result + ((vendorRelease == null) ? 0 : vendorRelease.hashCode());
133 public boolean equals(Object obj) {
136 if (!super.equals(obj))
138 if (getClass() != obj.getClass())
140 ResourceMetadataDataDefinition other = (ResourceMetadataDataDefinition) obj;
142 if (other.cost != null)
144 } else if (!cost.equals(other.cost))
146 if (isAbstract == null) {
147 if (other.isAbstract != null)
149 } else if (!isAbstract.equals(other.isAbstract))
151 if (licenseType == null) {
152 if (other.licenseType != null)
154 } else if (!licenseType.equals(other.licenseType))
156 if (resourceType != other.resourceType)
158 if (vendorName == null) {
159 if (other.vendorName != null)
161 } else if (!vendorName.equals(other.vendorName))
163 if (vendorRelease == null) {
164 if (other.vendorRelease != null)
167 if (toscaResourceName == null) {
168 if (other.toscaResourceName != null)
170 } else if (!vendorRelease.equals(other.vendorRelease))
173 return super.equals(obj);