81a5942e467ef8df4755d7cfac861ef0ae9b9a00
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / domain / PersUserAppSelection.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 app selections.
26  */
27 public class PersUserAppSelection extends DomainVo {
28
29         private static final long serialVersionUID = 1545308654500121206L;
30
31         private Long userId;
32
33         private Long appId;
34
35         private String statusCode;
36
37         public PersUserAppSelection() {}
38         
39         /**
40          * Convenience constructor
41          * 
42          * @param id
43          * @param userId
44          * @param appId
45          * @param statusCode
46          */
47         public PersUserAppSelection(final Long id, final Long userId, final Long appId, final String statusCode) {
48                 super.id = id;
49                 this.userId = userId;
50                 this.appId = appId;
51                 this.statusCode = statusCode;
52         }
53         
54         public Long getAppId() {
55                 return appId;
56         }
57
58         public void setAppId(Long appId) {
59                 this.appId = appId;
60         }
61
62         public Long getUserId() {
63                 return userId;
64         }
65
66         public void setUserId(Long userId) {
67                 this.userId = userId;
68         }
69
70         public String getStatusCode() {
71                 return statusCode;
72         }
73
74         public void setStatusCode(String statusCode) {
75                 this.statusCode = statusCode;
76         }
77
78         @Override
79         public int hashCode() {
80                 final int prime = 31;
81                 int result = 1;
82                 result = prime * result + ((appId == null) ? 0 : appId.hashCode());
83                 result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
84                 result = prime * result + ((userId == null) ? 0 : userId.hashCode());
85                 return result;
86         }
87
88         @Override
89         public boolean equals(Object obj) {
90                 if (this == obj)
91                         return true;
92                 if (obj == null)
93                         return false;
94                 if (getClass() != obj.getClass())
95                         return false;
96                 PersUserAppSelection other = (PersUserAppSelection) obj;
97                 if (appId == null) {
98                         if (other.appId != null)
99                                 return false;
100                 } else if (!appId.equals(other.appId))
101                         return false;
102                 if (statusCode == null) {
103                         if (other.statusCode != null)
104                                 return false;
105                 } else if (!statusCode.equals(other.statusCode))
106                         return false;
107                 if (userId == null) {
108                         if (other.userId != null)
109                                 return false;
110                 } else if (!userId.equals(other.userId))
111                         return false;
112                 return true;
113         }
114
115 }