Skip to content

Instantly share code, notes, and snippets.

@jshiell
Created November 24, 2011 11:56
Show Gist options
  • Save jshiell/1391187 to your computer and use it in GitHub Desktop.
Save jshiell/1391187 to your computer and use it in GitHub Desktop.
Scala equals/hashCode/toString Live Template
override def toString = new ToStringBuilder(this)
.toString
override def equals(obj: Any) = obj match {
case other: $CLASSNAME$ => other.getClass == getClass &&
new EqualsBuilder()
.isEquals
case _ => false
}
override def hashCode = new HashCodeBuilder(13, 19)
.hashCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment