Chromium Code Reviews| Index: components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java |
| diff --git a/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java b/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java |
| index 045618ba9dc19998a017dc4f6c20f7b0b2f581be..4474dfd5ce72caf8391d1c47716d62d8c6f5fcf1 100644 |
| --- a/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java |
| +++ b/components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/ContentId.java |
| @@ -20,4 +20,29 @@ public class ContentId { |
| this.namespace = namespace; |
| this.id = id; |
| } |
| + |
|
gone
2017/03/20 19:03:36
Also randomly added?
David Trainor- moved to gerrit
2017/03/25 03:31:13
See comment in OfflineItem.java.
|
| + @Override |
| + public String toString() { |
| + return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " [" + namespace |
| + + ", " + id + "]"; |
| + } |
| + |
| + @Override |
| + public boolean equals(Object o) { |
| + if (this == o) return true; |
| + if (!(o instanceof ContentId)) return false; |
| + |
| + ContentId lhs = (ContentId) o; |
|
fgorski
2017/03/20 20:19:20
rhs?
Both because this is right of equals and you
David Trainor- moved to gerrit
2017/03/25 03:31:13
Done.
|
| + return namespace == lhs.namespace && id == lhs.id; |
| + } |
| + |
| + @Override |
| + public int hashCode() { |
| + int result = 61; |
| + |
| + result = 31 * result + (namespace == null ? 0 : namespace.hashCode()); |
| + result = 31 * result + (id == null ? 0 : id.hashCode()); |
| + |
| + return result; |
| + } |
| } |