SEC-176: Add hashCode() method.

This commit is contained in:
Ben Alex 2006-02-09 03:36:47 +00:00
parent ac457021b8
commit c9cee6651c

View File

@ -137,6 +137,20 @@ public class WebAuthenticationDetails implements SessionIdentifierAware,
return sessionId;
}
public int hashCode() {
int code = 7654;
if (this.remoteAddress != null) {
code = code * (this.remoteAddress.hashCode() % 7);
}
if (this.sessionId != null) {
code = code * (this.sessionId.hashCode() % 7);
}
return code;
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(super.toString() + ": ");