[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-lib/master] Provide 'equals' and 'hashCode' implementations.



commit dc019152886f018f39ecbcba24c3490e2eed8057
Author: iwakeh <iwakeh@xxxxxxxxxxxxxx>
Date:   Wed Jan 31 12:35:36 2018 +0000

    Provide 'equals' and 'hashCode' implementations.
---
 .../torproject/descriptor/log/WebServerAccessLogLine.java  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/main/java/org/torproject/descriptor/log/WebServerAccessLogLine.java b/src/main/java/org/torproject/descriptor/log/WebServerAccessLogLine.java
index 2f27441..a4e3ce6 100644
--- a/src/main/java/org/torproject/descriptor/log/WebServerAccessLogLine.java
+++ b/src/main/java/org/torproject/descriptor/log/WebServerAccessLogLine.java
@@ -156,5 +156,19 @@ public class WebServerAccessLogLine {
     }
   }
 
+  @Override
+  public boolean equals(Object other) {
+    if (null != other && other instanceof WebServerAccessLogLine) {
+      return this.toLogString()
+          .equals(((WebServerAccessLogLine)other).toLogString());
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    return this.toLogString().hashCode();
+  }
+
 }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits