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