@Override public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (attributes != null ? attributes.size() : 0); result = 31 * result + weight; result = 31 * result + (children != null ? children.size() : 0); result = 31 * result + (body != null ? body.body().length() : 0); return result; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Element element = (Element) o; return weight == element.weight && !(attributes != null ? !attributes.equals(element.attributes) : element.attributes != null) && !(body != null ? !body.equals(element.body) : element.body != null) && !(children != null ? !children.equals(element.children) : element.children != null) && !(id != null ? !id.equals(element.id) : element.id != null) && !(type != null ? !type.equals(element.type) : element.type != null); }