push addional code
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-software-product-lib / openecomp-sdc-vendor-software-product-api / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / types / composition / ComponentData.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.vendorsoftwareproduct.types.composition;
22
23 public class ComponentData implements CompositionDataEntity {
24   private String name;
25   private String description;
26   private String displayName;
27
28   public String getName() {
29     return name;
30   }
31
32   public void setName(String name) {
33     this.name = name;
34   }
35
36   public String getDescription() {
37     return description;
38   }
39
40   public void setDescription(String description) {
41     this.description = description;
42   }
43
44   public String getDisplayName() {
45     return displayName;
46   }
47
48   public void setDisplayName(String displayName) {
49     this.displayName = displayName;
50   }
51
52   @Override
53   public boolean equals(Object obj) {
54     if (this == obj) {
55       return true;
56     }
57     if (!(obj instanceof ComponentData)) {
58       return false;
59     }
60
61     ComponentData that = (ComponentData) obj;
62
63     if (!name.equals(that.name)) {
64       return false;
65     }
66     if (description != null ? !description.equals(that.description) : that.description != null) {
67       return false;
68     }
69     return displayName != null ? displayName.equals(that.displayName) : that.displayName == null;
70
71   }
72
73   @Override
74   public int hashCode() {
75     int result = name.hashCode();
76     result = 31 * result + (description != null ? description.hashCode() : 0);
77     result = 31 * result + (displayName != null ? displayName.hashCode() : 0);
78     return result;
79   }
80 }