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.tosca.ToscaDataDefinition;
27 public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefinition implements Serializable {
32 private static final long serialVersionUID = -7661001892509435120L;
33 public static final String EMPTY_STR = "";
35 private String distributionStatus;
36 private String serviceType;
37 private String serviceRole;
39 private Boolean ecompGeneratedNaming = true;
41 private String namingPolicy = EMPTY_STR;
43 public ServiceMetadataDataDefinition() {
49 public ServiceMetadataDataDefinition(ServiceMetadataDataDefinition other) {
51 serviceType = other.getServiceType();
52 serviceRole = other.getServiceRole();
55 public String getDistributionStatus() {
56 return distributionStatus;
59 public void setDistributionStatus(String distributionStatus) {
60 this.distributionStatus = distributionStatus;
63 public String getServiceType(){
67 public void setServiceType(String serviceType){
68 this.serviceType = serviceType;
71 public String getServiceRole(){
75 public void setServiceRole(String serviceRole){
76 this.serviceRole = serviceRole;
79 public Boolean isEcompGeneratedNaming() {
80 return ecompGeneratedNaming;
83 public void setEcompGeneratedNaming(Boolean ecompGeneratedNaming) {
84 this.ecompGeneratedNaming = ecompGeneratedNaming;
87 public String getNamingPolicy() {
91 public void setNamingPolicy(String namingPolicy) {
92 this.namingPolicy = namingPolicy;
96 public String toString() {
97 return "ServiceMetadataDataDefinition [ distributionStatus=" + distributionStatus
98 + ", serviceType=" + serviceType + ", serviceRole=" + serviceRole + ", ecompGeneratedNaming="
99 + ecompGeneratedNaming + ", namingPolicy=" + namingPolicy + ", parent=" + super.toString() + "]";
103 public int hashCode() {
104 final int prime = 31;
105 int result = super.hashCode();
106 result = prime * result + ((distributionStatus == null) ? 0 : distributionStatus.hashCode());
107 result = prime * result + ((ecompGeneratedNaming == null) ? 0 : ecompGeneratedNaming.hashCode());
108 result = prime * result + ((namingPolicy == null) ? 0 : namingPolicy.hashCode());
109 result = prime * result + ((serviceType == null) ? 0 : serviceType.hashCode());
110 result = prime * result + ((serviceRole == null) ? 0 : serviceRole.hashCode());
115 public boolean equals(Object obj) {
120 if (!(obj instanceof ComponentMetadataDataDefinition)) {
123 if (!super.equals(obj)) {
126 if (getClass() != obj.getClass())
128 ServiceMetadataDataDefinition other = (ServiceMetadataDataDefinition) obj;
129 if (distributionStatus == null) {
130 if (other.distributionStatus != null)
132 } else if (!distributionStatus.equals(other.distributionStatus))
134 if (ecompGeneratedNaming == null) {
135 if (other.ecompGeneratedNaming != null)
137 } else if (!ecompGeneratedNaming.equals(other.ecompGeneratedNaming))
139 if (namingPolicy == null) {
140 if (other.namingPolicy != null)
142 } else if (!namingPolicy.equals(other.namingPolicy))
144 if (serviceType == null){
145 if (other.serviceType != null)
147 } else if (!serviceType.equals(other.serviceType))
149 if (serviceRole == null){
150 if (other.serviceRole != null)
152 } else if (!serviceRole.equals(other.serviceRole))
154 return super.equals(obj);