cedric
04/16/2017, 2:40 PMequals()
and hashCode()
are not methods where you want to do that. Guava has some helper methods, though: https://gist.github.com/rocketraman/1399080/a50ea2206f6ea4bda65ef00d1f54aab6d654d3bdPaul Woitaschek
04/17/2017, 7:31 AMfun hashCodeOf(vararg elements: Any?): Int {
var hash = 17
elements.forEach {
hash = hash * 31 + (it?.hashCode() ?: 0)
}
return hash
}
cedric
04/17/2017, 2:16 PMPaul Woitaschek
04/17/2017, 4:18 PM