diff options
author | John Wang <johnwang@google.com> | 2011-04-04 12:35:42 -0700 |
---|---|---|
committer | John Wang <johnwang@google.com> | 2011-04-07 12:36:56 -0700 |
commit | 4e900091c4da26eb1c9f0d232ee0e50f4522cc69 (patch) | |
tree | 3d0253a7c9364cc7b402aeec9ddd6e0214d41a27 /core/java/android/net/LinkAddress.java | |
parent | 826af8576b27d18997440bec75daa26434033c0c (diff) | |
download | frameworks_base-4e900091c4da26eb1c9f0d232ee0e50f4522cc69.zip frameworks_base-4e900091c4da26eb1c9f0d232ee0e50f4522cc69.tar.gz frameworks_base-4e900091c4da26eb1c9f0d232ee0e50f4522cc69.tar.bz2 |
Make LinkProperties comparable.
Add equals() and hashcode() to LinkProperties and related fields.
Bug:3501569
Change-Id: Ifa737a67c16867ac43cf76bf618a483e612a189e
Diffstat (limited to 'core/java/android/net/LinkAddress.java')
-rw-r--r-- | core/java/android/net/LinkAddress.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/net/LinkAddress.java b/core/java/android/net/LinkAddress.java index 9c36b12..f6a114c 100644 --- a/core/java/android/net/LinkAddress.java +++ b/core/java/android/net/LinkAddress.java @@ -78,6 +78,14 @@ public class LinkAddress implements Parcelable { this.prefixLength == linkAddress.prefixLength; } + @Override + /* + * generate hashcode based on significant fields + */ + public int hashCode() { + return ((null == address) ? 0 : address.hashCode()) + prefixLength; + } + /** * Returns the InetAddress for this address. */ |