9317b9fef6eb48eac86e5a4c111e9c691fe837ee
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / transport / CentralUserApp.java
1 package org.openecomp.portalapp.portal.transport;
2
3 @SuppressWarnings("rawtypes")
4 public class CentralUserApp implements Comparable{
5         
6         private Long userId;
7         private CentralApp app;
8         private CentralRole role;
9         private Short priority;
10         
11         
12         
13         public Long getUserId() {
14                 return userId;
15         }
16
17
18
19         public void setUserId(Long userId) {
20                 this.userId = userId;
21         }
22
23
24
25         public CentralApp getApp() {
26                 return app;
27         }
28
29
30
31         public void setApp(CentralApp app) {
32                 this.app = app;
33         }
34
35
36
37         public CentralRole getRole() {
38                 return role;
39         }
40
41
42
43         public void setRole(CentralRole role) {
44                 this.role = role;
45         }
46
47
48
49         public Short getPriority() {
50                 return priority;
51         }
52
53
54
55         public void setPriority(Short priority) {
56                 this.priority = priority;
57         }
58
59
60
61         public int compareTo(Object other){
62             CentralUserApp castOther = (CentralUserApp) other;
63
64             Long c1 = (this.getUserId()==null ? 0 : this.getUserId()) + (this.priority==null ? 0 : this.priority);
65             Long c2 = (castOther.getUserId()==null ? 0 : castOther.getUserId()) + (castOther.getApp()==null||castOther.getApp().getId()==null ? 0 : castOther.getApp().getId()) + (castOther.priority==null ? 0 : castOther.priority);
66
67             return c1.compareTo(c2);
68         }
69         
70 }