diff options
Diffstat (limited to 'security-util-lib')
-rw-r--r-- | security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java | 34 |
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 + - '}'; - } } |