[SDC-29] catalog 1707 rebase commit.
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / components / ServiceMetadataDataDefinition.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.sdc.be.datatypes.components;
22
23 import java.io.Serializable;
24
25 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
26
27 public class ServiceMetadataDataDefinition extends ComponentMetadataDataDefinition implements Serializable {
28
29         /**
30          * 
31          */
32         private static final long serialVersionUID = -7661001892509435120L;
33         public static final String EMPTY_STR = "";
34
35         private String distributionStatus;
36
37         private Boolean ecompGeneratedNaming = true;
38
39         private String namingPolicy = EMPTY_STR;
40
41         public ServiceMetadataDataDefinition() {
42                 super();
43         }
44
45         public ServiceMetadataDataDefinition(ServiceMetadataDataDefinition other) {
46                 super(other);
47         }
48
49         public String getDistributionStatus() {
50                 return distributionStatus;
51         }
52
53         public void setDistributionStatus(String distributionStatus) {
54                 this.distributionStatus = distributionStatus;
55         }
56
57         public Boolean isEcompGeneratedNaming() {
58                 return ecompGeneratedNaming;
59         }
60
61         public void setEcompGeneratedNaming(Boolean ecompGeneratedNaming) {
62                 this.ecompGeneratedNaming = ecompGeneratedNaming;
63         }
64
65         public String getNamingPolicy() {
66                 return namingPolicy;
67         }
68
69         public void setNamingPolicy(String namingPolicy) {
70                 this.namingPolicy = namingPolicy;
71         }
72
73         @Override
74         public String toString() {
75                 return "ServiceMetadataDataDefinition [ distributionStatus=" + distributionStatus
76                                  + ", ecompGeneratedNaming=" + ecompGeneratedNaming + ", namingPolicy=" + namingPolicy
77                                  + ", parent=" + super.toString() + "]";
78         }
79
80         @Override
81         public int hashCode() {
82                 final int prime = 31;
83                 int result = super.hashCode();
84                 result = prime * result + ((distributionStatus == null) ? 0 : distributionStatus.hashCode());
85                 result = prime * result + ((ecompGeneratedNaming == null) ? 0 : ecompGeneratedNaming.hashCode());
86                 result = prime * result + ((namingPolicy == null) ? 0 : namingPolicy.hashCode());
87                 return result;
88         }
89
90         @Override
91         public boolean equals(Object obj) {
92                 if (this == obj)
93                         return true;
94                 if (obj == null)
95                         return false;
96                 if (!(obj instanceof ComponentMetadataDataDefinition)) {
97                         return false;
98                 }
99                 if (!super.equals(obj)) {
100                         return false;
101                 }
102                 if (getClass() != obj.getClass())
103                         return false;
104                 ServiceMetadataDataDefinition other = (ServiceMetadataDataDefinition) obj;
105                 if (distributionStatus == null) {
106                         if (other.distributionStatus != null)
107                                 return false;
108                 } else if (!distributionStatus.equals(other.distributionStatus))
109                         return false;
110                 if (ecompGeneratedNaming == null) {
111                         if (other.ecompGeneratedNaming != null)
112                                 return false;
113                 } else if (!ecompGeneratedNaming.equals(other.ecompGeneratedNaming))
114                         return false;
115                 if (namingPolicy == null) {
116                         if (other.namingPolicy != null)
117                                 return false;
118                 } else if (!namingPolicy.equals(other.namingPolicy))
119                         return false;
120                 return super.equals(obj);
121         }
122
123 }