From ecfe375994b7561d37a07f8879740b1c85f260a2 Mon Sep 17 00:00:00 2001 From: "Kishore Reddy, Gujja (kg811t)" Date: Wed, 15 Aug 2018 08:39:30 -0400 Subject: Modified User Auth and permission aaf services Issue-ID: PORTAL-334 Change-Id: I461fd5a61879434e9c105c7598e9948004a5f608 Signed-off-by: Kishore Reddy, Gujja (kg811t) --- .../org/onap/portalsdk/core/domain/UserApp.java | 25 ++++++++-------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'ecomp-sdk/epsdk-domain/src/main') 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; } } -- cgit 1.2.3-korg