28d187ec690f945ad2dd8ea743f274d80e9b9dd7
[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   private String vfcCode;
28
29   public String getName() {
30     return name;
31   }
32
33   public void setName(String name) {
34     this.name = name;
35   }
36
37   public String getDescription() {
38     return description;
39   }
40
41   public void setDescription(String description) {
42     this.description = description;
43   }
44
45   public String getDisplayName() {
46     return displayName;
47   }
48
49   public void setDisplayName(String displayName) {
50     this.displayName = displayName;
51   }
52
53   @Override
54   public int hashCode() {
55     int result = name.hashCode();
56     result = 31 * result + (description != null ? description.hashCode() : 0);
57     result = 31 * result + (displayName != null ? displayName.hashCode() : 0);
58     return result;
59   }
60
61   @Override
62   public boolean equals(Object object) {
63     if (this == object) {
64       return true;
65     }
66     if (!(object instanceof ComponentData)) {
67       return false;
68     }
69
70     ComponentData that = (ComponentData) object;
71
72     if (!name.equals(that.name)) {
73       return false;
74     }
75     if (description != null ? !description.equals(that.description) : that.description != null) {
76       return false;
77     }
78     return displayName != null ? displayName.equals(that.displayName) : that.displayName == null;
79
80   }
81
82   public String getVfcCode() {
83     return vfcCode;
84   }
85
86   public void setVfcCode(String vfcCode) {
87     this.vfcCode = vfcCode;
88   }
89 }