summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlana Paktor <ilanap@amdocs.com>2019-11-28 15:49:33 +0000
committerGerrit Code Review <gerrit@onap.org>2019-11-28 15:49:33 +0000
commita3100af1c6b572f4f588e7a80eb263fc5b91510e (patch)
tree141ab1e28aa09aa3fbe157ff5a0b702d48f10fb1
parent077af724de371b1c2d492d3188962e56429c084f (diff)
parentac3b789c707846274a155e123c8f2de695bd22bb (diff)
Merge "Fix Sonar issues"
-rw-r--r--security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java34
1 files changed, 4 insertions, 30 deletions
diff --git a/security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java b/security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java
index 9440eea..b8f3afa 100644
--- a/security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java
+++ b/security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java
@@ -21,9 +21,13 @@
package org.onap.sdc.security;
import java.util.Set;
+import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
+import lombok.ToString;
+@EqualsAndHashCode
+@ToString
public class AuthenticationCookie {
@Getter @Setter
@@ -72,35 +76,5 @@ public class AuthenticationCookie {
this.lastName = lastName;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof AuthenticationCookie)) return false;
- AuthenticationCookie that = (AuthenticationCookie) o;
-
- if (getMaxSessionTime() != that.getMaxSessionTime()) return false;
- if (getCurrentSessionTime() != that.getCurrentSessionTime()) return false;
- if (getUserID() != null ? !getUserID().equals(that.getUserID()) : that.getUserID() != null) return false;
- return getRoles() != null ? getRoles().containsAll(that.getRoles()) : that.getRoles() == null;
- }
-
- @Override
- public int hashCode() {
- int result = getUserID() != null ? getUserID().hashCode() : 0;
- result = 31 * result + (getRoles() != null ? getRoles().hashCode() : 0);
- result = 31 * result + (int) (getMaxSessionTime() ^ (getMaxSessionTime() >>> 32));
- result = 31 * result + (int) (getCurrentSessionTime() ^ (getCurrentSessionTime() >>> 32));
- return result;
- }
-
- @Override
- public String toString() {
- return "AuthenticationCookie{" +
- "userID='" + userID + '\'' +
- ", roles=" + roles +
- ", maxSessionTime=" + maxSessionTime +
- ", currentSessionTime=" + currentSessionTime +
- '}';
- }
}