Created
July 26, 2012 08:44
-
-
Save jshiell/3181039 to your computer and use it in GitHub Desktop.
IntelliJ IDEA live template for Apache Commons Lang 3 Equals/HashCode/ToString
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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