@Override public final boolean deepEquals(Node node) { if (node == this) { return true; } if (node == null || !getClass().equals(node.getClass())) { return false; } final AbstractContentNode other = (AbstractContentNode) node; return Objects.equals(getContent(), other.getContent()); }
protected AbstractContentNode(Parent parent, String content) { super(); setParent(parent); setContent(content); }
private static String toString(Node node) { final StringBuilder builder = new StringBuilder(); builder.append(node.getType()); switch (node.getType()) { case COMMENT: case TEXT: builder.append(" '" + StringUtil.extract(((AbstractContentNode) node).getContent(), 10) + "'"); break; case ELEMENT: builder.append(" " + ((Element) node).getName()); break; default: break; } return builder.toString(); } }