if (query.parameters.size() != parameters.size()) {
return false;
}
EqualsBuilder builder = new EqualsBuilder();
for (Map.Entry<String, ?> entry : parameters.entrySet()) {
String entryKey = entry.getKey();
Object entryValue = entry.getValue();
if (entryValue == null) {
if (query.parameters.get(entryKey) != null
|| !query.parameters.containsKey(entryKey)) {
return false;
}
}
else {
// takes care of comparing primitive arrays, such as byte[]
builder.append(entryValue, query.parameters.get(entryKey));
if (!builder.isEquals()) {
return false;
}
}
}