Skip to content

Instantly share code, notes, and snippets.

@jshiell
Created July 26, 2012 08:44
Show Gist options
  • Save jshiell/3181039 to your computer and use it in GitHub Desktop.
Save jshiell/3181039 to your computer and use it in GitHub Desktop.
IntelliJ IDEA live template for Apache Commons Lang 3 Equals/HashCode/ToString
@Override
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj.getClass() != getClass()) {
return false;
}
final $CLASS$ rhs = ($CLASS$) obj;
return new org.apache.commons.lang3.builder.EqualsBuilder()
.append(object, rhs.object)
.isEquals();
}
@Override
public int hashCode() {
return new org.apache.commons.lang3.builder.HashCodeBuilder()
.append(object)
.toHashCode();
}
@Override
public String toString() {
return new org.apache.commons.lang3.builder.ToStringBuilder(this)
.append(object)
.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment