5ef8a21b27f8e59a3ba16f1c340f031f658ee2a0
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / domain / PersUserWidgetSelection.java
1 /*-
2  * ================================================================================
3  * ECOMP Portal
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
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  * ================================================================================
19  */
20 package org.openecomp.portalapp.portal.domain;
21
22 import org.openecomp.portalsdk.core.domain.support.DomainVo;
23
24 /**
25  * Models a row in the table with personalization of user widget selections.
26  */
27 public class PersUserWidgetSelection extends DomainVo {
28
29         /**
30          * 
31          */
32         private static final long serialVersionUID = -6547880514779039200L;
33
34         private Long userId;
35
36         private Long widgetId;
37
38         private String statusCode;
39
40         public PersUserWidgetSelection() {}
41         
42         /**
43          * Convenience constructor
44          * 
45          * @param id
46          * @param userId
47          * @param widgetId
48          * @param statusCode
49          */
50         public PersUserWidgetSelection(final Long id, final Long userId, final Long widgetId, final String statusCode) {
51                 super.id = id;
52                 this.userId = userId;
53                 this.widgetId = widgetId;
54                 this.statusCode = statusCode;
55         }
56         
57         public Long getWidgetId() {
58                 return widgetId;
59         }
60
61         public void setWidgetId(Long widgetId) {
62                 this.widgetId = widgetId;
63         }
64
65         public Long getUserId() {
66                 return userId;
67         }
68
69         public void setUserId(Long userId) {
70                 this.userId = userId;
71         }
72
73         public String getStatusCode() {
74                 return statusCode;
75         }
76
77         public void setStatusCode(String statusCode) {
78                 this.statusCode = statusCode;
79         }
80
81         @Override
82         public int hashCode() {
83                 final int prime = 31;
84                 int result = 1;
85                 result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
86                 result = prime * result + ((userId == null) ? 0 : userId.hashCode());
87                 result = prime * result + ((widgetId == null) ? 0 : widgetId.hashCode());
88                 return result;
89         }
90
91         @Override
92         public boolean equals(Object obj) {
93                 if (this == obj)
94                         return true;
95                 if (obj == null)
96                         return false;
97                 if (getClass() != obj.getClass())
98                         return false;
99                 PersUserWidgetSelection other = (PersUserWidgetSelection) obj;
100                 if (statusCode == null) {
101                         if (other.statusCode != null)
102                                 return false;
103                 } else if (!statusCode.equals(other.statusCode))
104                         return false;
105                 if (userId == null) {
106                         if (other.userId != null)
107                                 return false;
108                 } else if (!userId.equals(other.userId))
109                         return false;
110                 if (widgetId == null) {
111                         if (other.widgetId != null)
112                                 return false;
113                 } else if (!widgetId.equals(other.widgetId))
114                         return false;
115                 return true;
116         }
117         
118 }