MCPcopy Create free account
hub / github.com/apache/nutch / equals

Method equals

src/java/org/apache/nutch/metadata/Metadata.java:187–217  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

185 }
186
187 public boolean equals(Object o) {
188
189 if (o == null) {
190 return false;
191 }
192
193 if (!Metadata.class.isAssignableFrom(o.getClass())) {
194 return false;
195 }
196
197 Metadata other = (Metadata) o;
198
199 if (other.size() != size()) {
200 return false;
201 }
202
203 String[] names = names();
204 for (int i = 0; i < names.length; i++) {
205 String[] otherValues = other._getValues(names[i]);
206 String[] thisValues = _getValues(names[i]);
207 if (otherValues.length != thisValues.length) {
208 return false;
209 }
210 for (int j = 0; j < otherValues.length; j++) {
211 if (!otherValues[j].equals(thisValues[j])) {
212 return false;
213 }
214 }
215 }
216 return true;
217 }
218
219 public String toString() {
220 StringBuffer buf = new StringBuffer();

Callers 2

testObjectMethod · 0.95

Calls 3

sizeMethod · 0.95
namesMethod · 0.95
_getValuesMethod · 0.95

Tested by 1

testObjectMethod · 0.76