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 public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefinition implements Serializable {
30 private static final long serialVersionUID = -7661001892509435120L;
31 public static final String EMPTY_STR = "";
33 private String distributionStatus;
34 private String serviceType;
35 private String serviceRole;
37 private Boolean ecompGeneratedNaming = true;
39 private String namingPolicy = EMPTY_STR;
41 private String environmentContext;
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;
95 public String getEnvironmentContext() { return environmentContext; }
97 public void setEnvironmentContext(String environmentContext) { this.environmentContext = environmentContext; }
100 public String toString() {
101 return "ServiceMetadataDataDefinition{" +
102 "distributionStatus='" + distributionStatus + '\'' +
103 ", serviceType='" + serviceType + '\'' +
104 ", serviceRole='" + serviceRole + '\'' +
105 ", ecompGeneratedNaming=" + ecompGeneratedNaming +
106 ", namingPolicy='" + namingPolicy + '\'' +
107 ", environmentContext='" + environmentContext + '\'' +
112 public int hashCode() {
113 final int prime = 31;
114 int result = super.hashCode();
115 result = prime * result + ((distributionStatus == null) ? 0 : distributionStatus.hashCode());
116 result = prime * result + ((ecompGeneratedNaming == null) ? 0 : ecompGeneratedNaming.hashCode());
117 result = prime * result + ((namingPolicy == null) ? 0 : namingPolicy.hashCode());
118 result = prime * result + ((serviceType == null) ? 0 : serviceType.hashCode());
119 result = prime * result + ((serviceRole == null) ? 0 : serviceRole.hashCode());
120 result = prime * result + ((environmentContext == null) ? 0 : environmentContext.hashCode());
125 public boolean equals(Object obj) {
130 if (!(obj instanceof ComponentMetadataDataDefinition)) {
133 if (!super.equals(obj)) {
136 if (getClass() != obj.getClass())
138 ServiceMetadataDataDefinition other = (ServiceMetadataDataDefinition) obj;
139 if (distributionStatus == null) {
140 if (other.distributionStatus != null)
142 } else if (!distributionStatus.equals(other.distributionStatus))
144 if (ecompGeneratedNaming == null) {
145 if (other.ecompGeneratedNaming != null)
147 } else if (!ecompGeneratedNaming.equals(other.ecompGeneratedNaming))
149 if (namingPolicy == null) {
150 if (other.namingPolicy != null)
152 } else if (!namingPolicy.equals(other.namingPolicy))
154 if (serviceType == null){
155 if (other.serviceType != null)
157 } else if (!serviceType.equals(other.serviceType))
159 if (serviceRole == null){
160 if (other.serviceRole != null)
162 } else if (!serviceRole.equals(other.serviceRole))
164 if (environmentContext == null){
165 if (other.environmentContext != null)
167 } else if (!environmentContext.equals(other.environmentContext))
169 return super.equals(obj);
173 public String getActualComponentType() {
175 return componentType.getValue();