Add equality checking to each command node

This commit is contained in:
Nathan Adams
2014-09-25 16:34:44 +02:00
parent f91bc15e19
commit 5760f94009
6 changed files with 128 additions and 0 deletions
@@ -13,4 +13,21 @@ public class RootCommandNode extends CommandNode {
public String parse(String command, CommandContextBuilder contextBuilder) throws IllegalArgumentSyntaxException, ArgumentValidationException {
return command;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof RootCommandNode)) return false;
RootCommandNode that = (RootCommandNode) o;
if (!getChildren().equals(that.getChildren())) return false;
return true;
}
@Override
public int hashCode() {
return getChildren().hashCode();
}
}