SOLR-458 -- Add equals and hashCode methods to NamedList

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@779486 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2009-05-28 08:48:29 +00:00
parent df9b290629
commit a6cd8495bb
2 changed files with 38 additions and 24 deletions

View File

@ -487,6 +487,8 @@ Other Changes
35. SOLR-786: Refactor DisMaxQParser to allow overriding certain features of DisMaxQParser
(Wojciech Biela via shalin)
36. SOLR-458: Add equals and hashCode methods to NamedList (Stefan Rinner, shalin)
Build
----------------------
1. SOLR-776: Added in ability to sign artifacts via Ant for releases (gsingers)

View File

@ -376,4 +376,16 @@ public class NamedList<T> implements Cloneable, Serializable, Iterable<Map.Entry
if(idx != -1) return remove(idx);
return null;
}
@Override
public int hashCode() {
return nvPairs.hashCode();
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof NamedList)) return false;
NamedList nl = (NamedList) obj;
return this.nvPairs.equals(nl.nvPairs);
}
}