[PORTAL-7] Rebase
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / transport / BusinessCardApplicationRole.java
1 /*-\r
2  * ================================================================================\r
3  * ECOMP Portal\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ================================================================================\r
19  */\r
20 package org.openecomp.portalapp.portal.transport;\r
21 \r
22 import java.io.Serializable;\r
23 \r
24 import javax.persistence.Column;\r
25 import javax.persistence.Entity;\r
26 import javax.persistence.Id;\r
27 \r
28 import com.fasterxml.jackson.annotation.JsonInclude;\r
29 \r
30 @Entity\r
31 @JsonInclude(JsonInclude.Include.NON_NULL)\r
32 public class BusinessCardApplicationRole implements Serializable{\r
33         \r
34         /**\r
35          * \r
36          */\r
37         private static final long serialVersionUID = 1L;\r
38 \r
39 \r
40         public BusinessCardApplicationRole() {\r
41         }\r
42 \r
43         \r
44     @Id\r
45         @Column(name="app_name")\r
46         private String appName;\r
47         \r
48         @Id\r
49         @Column(name="role_name")\r
50         private String roleName;\r
51 \r
52 \r
53         public String getAppName() {\r
54                 return appName;\r
55         }\r
56 \r
57         public void setAppName(String appName) {\r
58                 this.appName = appName;\r
59         }\r
60 \r
61 \r
62 \r
63         public String getRoleName() {\r
64                 return roleName;\r
65         }\r
66 \r
67         public void setRoleName(String roleName) {\r
68                 this.roleName = roleName;\r
69         }\r
70 \r
71         @Override\r
72         public String toString() {\r
73                 return "BusinessCardUserApplicationRoles [appName=" + appName + ", roleName=" + roleName + "]";\r
74         }\r
75 \r
76         @Override\r
77         public int hashCode() {\r
78                 final int prime = 31;\r
79                 int result = 1;\r
80                 result = prime * result + ((appName == null) ? 0 : appName.hashCode());\r
81                 result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());\r
82                 return result;\r
83         }\r
84 \r
85         @Override\r
86         public boolean equals(Object obj) {\r
87                 if (this == obj)\r
88                         return true;\r
89                 if (obj == null)\r
90                         return false;\r
91                 if (getClass() != obj.getClass())\r
92                         return false;\r
93                 BusinessCardApplicationRole other = (BusinessCardApplicationRole) obj;\r
94                 if (appName == null) {\r
95                         if (other.appName != null)\r
96                                 return false;\r
97                 } else if (!appName.equals(other.appName))\r
98                         return false;\r
99                 if (roleName == null) {\r
100                         if (other.roleName != null)\r
101                                 return false;\r
102                 } else if (!roleName.equals(other.roleName))\r
103                         return false;\r
104                 return true;\r
105         }       \r
106         \r
107 \r
108 }\r