ec2b07b5cd0ec29d396818cbb71440f2ab33c716
[sdc.git] /
1 /*
2  * Copyright © 2016-2018 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
18
19 public class ComponentData implements CompositionDataEntity {
20   private String name;
21   private String description;
22   private String displayName;
23
24   public String getName() {
25     return name;
26   }
27
28   public void setName(String name) {
29     this.name = name;
30   }
31
32   public String getDescription() {
33     return description;
34   }
35
36   public void setDescription(String description) {
37     this.description = description;
38   }
39
40   public String getDisplayName() {
41     return displayName;
42   }
43
44   public void setDisplayName(String displayName) {
45     this.displayName = displayName;
46   }
47
48   @Override
49   public int hashCode() {
50     int result = name.hashCode();
51     result = 31 * result + (description != null ? description.hashCode() : 0);
52     result = 31 * result + (displayName != null ? displayName.hashCode() : 0);
53     return result;
54   }
55
56   @Override
57   public boolean equals(Object object) {
58     if (this == object) {
59       return true;
60     }
61     if (!(object instanceof ComponentData)) {
62       return false;
63     }
64
65     ComponentData that = (ComponentData) object;
66
67     if (!name.equals(that.name)) {
68       return false;
69     }
70     if (description != null ? !description.equals(that.description) : that.description != null) {
71       return false;
72     }
73     return displayName != null ? displayName.equals(that.displayName) : that.displayName == null;
74
75   }
76 }