Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class IgnoreVariableAttributesDifferenceListener implements
DifferenceListener {
private static final List<String> IGNORE_ATTRS = Arrays
.asList(new String[] { "version", "download-size", "install-size" });
@Override
public int differenceFound(Difference difference) {
if (isIgnoredAttributeDifference(difference)) {
return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
} else {
return RETURN_ACCEPT_DIFFERENCE;
}
}
@Override
public void skippedComparison(Node control, Node test) {
// nothing to do
}
private boolean isIgnoredAttributeDifference(Difference difference) {
return difference.getId() == DifferenceConstants.ATTR_VALUE_ID
&& IGNORE_ATTRS.contains(difference.getControlNodeDetail()
.getNode().getNodeName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.