summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-domain/src/main/java
diff options
context:
space:
mode:
authorKishore Reddy, Gujja (kg811t) <kg811t@research.att.com>2018-08-15 08:39:30 -0400
committerKishore Reddy, Gujja (kg811t) <kg811t@research.att.com>2018-08-15 11:21:38 -0400
commitecfe375994b7561d37a07f8879740b1c85f260a2 (patch)
tree2876499d2adeecea4af8641662722a3a3627338d /ecomp-sdk/epsdk-domain/src/main/java
parent2e2ec498ce80d674c08ef8909adb5e1138b710bd (diff)
Modified User Auth and permission aaf services
Issue-ID: PORTAL-334 Change-Id: I461fd5a61879434e9c105c7598e9948004a5f608 Signed-off-by: Kishore Reddy, Gujja (kg811t) <kg811t@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-domain/src/main/java')
-rw-r--r--ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UserApp.java25
1 files changed, 9 insertions, 16 deletions
diff --git a/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UserApp.java b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UserApp.java
index 4eebb02f..aff5b1f1 100644
--- a/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UserApp.java
+++ b/ecomp-sdk/epsdk-domain/src/main/java/org/onap/portalsdk/core/domain/UserApp.java
@@ -2,7 +2,7 @@
* ============LICENSE_START==========================================
* ONAP Portal SDK
* ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
@@ -91,33 +91,26 @@ 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.getRole().getId() != null ? this.getRole().getId().equals(castOther.getRole().getId()) : this.getRole().getName().equals(castOther.getRole().getName()))
&& ((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());
+ Long result = 17l;
+ result = 37 * result + (int) (this.getUserId() == null ? 0 : this.getUserId().hashCode());
+ result = 37 * result + (int) (this.getApp().getId() == null ? 0 : this.getApp().getId().hashCode());
+ result = 37 * result + (int) (this.getRole().getId() == null ? (this.getRole().getName() == null ? 0 : this.getRole().getName().hashCode() ) : this.getRole().getId().hashCode());
result = 37 * result + (int) (this.priority == null ? 0 : this.priority);
- return result;
+ return Long.hashCode(result);
}
@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);
+ int c1 = this.hashCode() - castOther.hashCode();
+ return c1;
}
}