[PORTAL-16 PORTAL-18] Widget ms; staging
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / transport / BusinessCardApplicationRole.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.transport;
21
22 import java.io.Serializable;
23
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.Id;
27
28 import com.fasterxml.jackson.annotation.JsonInclude;
29
30 @Entity
31 @JsonInclude(JsonInclude.Include.NON_NULL)
32 public class BusinessCardApplicationRole implements Serializable{
33         
34         /**
35          * 
36          */
37         private static final long serialVersionUID = 1L;
38
39
40         public BusinessCardApplicationRole() {
41         }
42
43         
44     @Id
45         @Column(name="app_name")
46         private String appName;
47         
48         @Id
49         @Column(name="role_name")
50         private String roleName;
51
52
53         public String getAppName() {
54                 return appName;
55         }
56
57         public void setAppName(String appName) {
58                 this.appName = appName;
59         }
60
61
62
63         public String getRoleName() {
64                 return roleName;
65         }
66
67         public void setRoleName(String roleName) {
68                 this.roleName = roleName;
69         }
70
71         @Override
72         public String toString() {
73                 return "BusinessCardUserApplicationRoles [appName=" + appName + ", roleName=" + roleName + "]";
74         }
75
76         @Override
77         public int hashCode() {
78                 final int prime = 31;
79                 int result = 1;
80                 result = prime * result + ((appName == null) ? 0 : appName.hashCode());
81                 result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
82                 return result;
83         }
84
85         @Override
86         public boolean equals(Object obj) {
87                 if (this == obj)
88                         return true;
89                 if (obj == null)
90                         return false;
91                 if (getClass() != obj.getClass())
92                         return false;
93                 BusinessCardApplicationRole other = (BusinessCardApplicationRole) obj;
94                 if (appName == null) {
95                         if (other.appName != null)
96                                 return false;
97                 } else if (!appName.equals(other.appName))
98                         return false;
99                 if (roleName == null) {
100                         if (other.roleName != null)
101                                 return false;
102                 } else if (!roleName.equals(other.roleName))
103                         return false;
104                 return true;
105         }       
106         
107
108 }