@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode()); hashCode = prime * hashCode + ((getChanges() == null) ? 0 : getChanges().hashCode()); return hashCode; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getComment() != null) sb.append("Comment: ").append(getComment()).append(","); if (getChanges() != null) sb.append("Changes: ").append(getChanges()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ChangeBatch == false) return false; ChangeBatch other = (ChangeBatch) obj; if (other.getComment() == null ^ this.getComment() == null) return false; if (other.getComment() != null && other.getComment().equals(this.getComment()) == false) return false; if (other.getChanges() == null ^ this.getChanges() == null) return false; if (other.getChanges() != null && other.getChanges().equals(this.getChanges()) == false) return false; return true; }
xmlWriter.startElement("ChangeBatch"); if (changeBatch.getComment() != null) { xmlWriter.startElement("Comment").value(changeBatch.getComment()).endElement();