@Override
public int hashCode() {
if (this.hashCode == 0) {
HashCodeBuilder builder = new HashCodeBuilder(13, 17);
if (name != null) {
builder.append(name.hashCode());
}
if (parameters != null) {
Object[] keys = parameters.keySet().toArray();
Arrays.sort(keys);
for (Object key : keys) {
// HashCodeBuilder will take care of processing object if it
// happens to be a primitive array such as byte[]
builder.append(key).append(parameters.get(key));
}
}
this.hashCode = builder.toHashCode();
assert hashCode != 0 : "Generated zero hashCode";
}
return hashCode;
}