summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserApp.java
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserApp.java')
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserApp.java58
1 files changed, 26 insertions, 32 deletions
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserApp.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserApp.java
index 74f7dd75..edaf0013 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserApp.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/UserApp.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -37,29 +37,16 @@
*/
package org.onap.portalsdk.core.domain;
-import java.util.Set;
-import java.util.TreeSet;
-// Generated Aug 27, 2014 5:51:36 PM by Hibernate Tools 3.4.0.CR1
-
-/**
- * FnUserRole generated by hbm2java
- */
@SuppressWarnings("rawtypes")
public class UserApp implements java.io.Serializable, Comparable {
- /**
- *
- */
private static final long serialVersionUID = 1L;
private Long userId;
private App app;
private Role role;
private Short priority;
- public UserApp() {
- }
-
public Long getUserId() {
return userId;
}
@@ -83,7 +70,7 @@ public class UserApp implements java.io.Serializable, Comparable {
public void setRole(Role role) {
this.role = role;
}
-
+
public Short getPriority() {
return this.priority;
}
@@ -92,10 +79,11 @@ public class UserApp implements java.io.Serializable, Comparable {
this.priority = priority;
}
+ @Override
public boolean equals(Object other) {
- if ((this == other))
+ if (this == other)
return true;
- if ((other == null))
+ if (other == null)
return false;
if (!(other instanceof UserApp))
return false;
@@ -104,26 +92,32 @@ public class UserApp implements java.io.Serializable, Comparable {
return (this.getUserId().equals(castOther.getUserId()))
&& (this.getApp().getId().equals(castOther.getApp().getId()))
&& (this.getRole().getId().equals(castOther.getRole().getId()))
- && ((this.priority==null && castOther.getPriority()==null) || this.getPriority().equals(castOther.getPriority()));
+ && ((this.priority == null && castOther.getPriority() == null)
+ || this.getPriority().equals(castOther.getPriority()));
}
+ @Override
public int hashCode() {
int result = 17;
-
- result = 37 * result + (int) (this.getUserId()==null ? 0 : this.getUserId().intValue());
- result = 37 * result + (int) (this.getApp().getId()==null ? 0 : this.getApp().getId().intValue());
- result = 37 * result + (int) (this.getRole().getId()==null ? 0 : this.getRole().getId().intValue());
- result = 37 * result + (int) (this.priority==null ? 0 : this.priority);
+ result = 37 * result + (int) (this.getUserId() == null ? 0 : this.getUserId().intValue());
+ result = 37 * result + (int) (this.getApp().getId() == null ? 0 : this.getApp().getId().intValue());
+ result = 37 * result + (int) (this.getRole().getId() == null ? 0 : this.getRole().getId().intValue());
+ result = 37 * result + (int) (this.priority == null ? 0 : this.priority);
return result;
}
- public int compareTo(Object other){
- UserApp castOther = (UserApp) other;
-
- Long c1 = (this.getUserId()==null ? 0 : this.getUserId()) + (this.getApp()==null||this.getApp().getId()==null ? 0 : this.getApp().getId()) + (this.getRole()==null||this.getRole().getId()==null ? 0 : this.getRole().getId()) + (this.priority==null ? 0 : this.priority);
- Long c2 = (castOther.getUserId()==null ? 0 : castOther.getUserId()) + (castOther.getApp()==null||castOther.getApp().getId()==null ? 0 : castOther.getApp().getId()) + (castOther.getRole()==null||castOther.getRole().getId()==null ? 0 : castOther.getRole().getId()) + (castOther.priority==null ? 0 : castOther.priority);
-
- return c1.compareTo(c2);
- }
+ @Override
+ public int compareTo(Object other) {
+ UserApp castOther = (UserApp) other;
+ Long c1 = (this.getUserId() == null ? 0 : this.getUserId())
+ + (this.getApp() == null || this.getApp().getId() == null ? 0 : this.getApp().getId())
+ + (this.getRole() == null || this.getRole().getId() == null ? 0 : this.getRole().getId())
+ + (this.priority == null ? 0 : this.priority);
+ Long c2 = (castOther.getUserId() == null ? 0 : castOther.getUserId())
+ + (castOther.getApp() == null || castOther.getApp().getId() == null ? 0 : castOther.getApp().getId())
+ + (castOther.getRole() == null || castOther.getRole().getId() == null ? 0 : castOther.getRole().getId())
+ + (castOther.priority == null ? 0 : castOther.priority);
+ return c1.compareTo(c2);
+ }
}