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 public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefinition {
24 public static final String EMPTY_STR = "";
26 private String distributionStatus;
27 private String serviceType;
28 private String serviceRole;
29 private String instantiationType = EMPTY_STR;
31 private Boolean ecompGeneratedNaming = true;
33 private String namingPolicy = EMPTY_STR;
35 private String environmentContext;
37 public ServiceMetadataDataDefinition() {
43 public ServiceMetadataDataDefinition(ServiceMetadataDataDefinition other) {
45 serviceType = other.getServiceType();
46 serviceRole = other.getServiceRole();
49 public String getDistributionStatus() {
50 return distributionStatus;
53 public void setDistributionStatus(String distributionStatus) {
54 this.distributionStatus = distributionStatus;
57 public String getServiceType(){
61 public void setServiceType(String serviceType){
62 this.serviceType = serviceType;
65 public String getServiceRole(){
69 public String getInstantiationType() {
70 return instantiationType;
73 public void setInstantiationType(String instantiationType){
74 this.instantiationType = instantiationType;
77 public void setServiceRole(String serviceRole){
78 this.serviceRole = serviceRole;
81 public Boolean isEcompGeneratedNaming() {
82 return ecompGeneratedNaming;
85 public void setEcompGeneratedNaming(Boolean ecompGeneratedNaming) {
86 this.ecompGeneratedNaming = ecompGeneratedNaming;
89 public String getNamingPolicy() {
93 public void setNamingPolicy(String namingPolicy) {
94 this.namingPolicy = namingPolicy;
97 public String getEnvironmentContext() { return environmentContext; }
99 public void setEnvironmentContext(String environmentContext) { this.environmentContext = environmentContext; }
102 public String toString() {
103 return "ServiceMetadataDataDefinition{" +
104 "distributionStatus='" + distributionStatus + '\'' +
105 ", serviceType='" + serviceType + '\'' +
106 ", serviceRole='" + serviceRole + '\'' +
107 ", ecompGeneratedNaming=" + ecompGeneratedNaming +
108 ", namingPolicy='" + namingPolicy + '\'' +
109 ", environmentContext='" + environmentContext + '\'' +
110 ", instantiationType='" + instantiationType + '\'' +
115 public int hashCode() {
116 final int prime = 31;
117 int result = super.hashCode();
118 result = prime * result + ((distributionStatus == null) ? 0 : distributionStatus.hashCode());
119 result = prime * result + ((ecompGeneratedNaming == null) ? 0 : ecompGeneratedNaming.hashCode());
120 result = prime * result + ((namingPolicy == null) ? 0 : namingPolicy.hashCode());
121 result = prime * result + ((serviceType == null) ? 0 : serviceType.hashCode());
122 result = prime * result + ((serviceRole == null) ? 0 : serviceRole.hashCode());
123 result = prime * result + ((environmentContext == null) ? 0 : environmentContext.hashCode());
124 result = prime * result + ((instantiationType == null) ? 0 : instantiationType.hashCode());
129 public boolean equals(Object obj) {
134 if (!(obj instanceof ComponentMetadataDataDefinition)) {
137 if (!super.equals(obj)) {
140 if (getClass() != obj.getClass())
142 ServiceMetadataDataDefinition other = (ServiceMetadataDataDefinition) obj;
143 if (distributionStatus == null) {
144 if (other.distributionStatus != null)
146 } else if (!distributionStatus.equals(other.distributionStatus))
148 if (ecompGeneratedNaming == null) {
149 if (other.ecompGeneratedNaming != null)
151 } else if (!ecompGeneratedNaming.equals(other.ecompGeneratedNaming))
153 if (namingPolicy == null) {
154 if (other.namingPolicy != null)
156 } else if (!namingPolicy.equals(other.namingPolicy))
158 if (serviceType == null){
159 if (other.serviceType != null)
161 } else if (!serviceType.equals(other.serviceType))
163 if (serviceRole == null){
164 if (other.serviceRole != null)
166 } else if (!serviceRole.equals(other.serviceRole))
168 if (environmentContext == null){
169 if (other.environmentContext != null)
171 } else if (!environmentContext.equals(other.environmentContext))
173 if (instantiationType == null) {
174 if (other.instantiationType != null)
176 } else if (!instantiationType.equals(other.instantiationType))
178 return super.equals(obj);
182 public String getActualComponentType() {
184 return componentType != null ? componentType.getValue() : "";