net.sf.seaf.util
Class HashCodeUtils
java.lang.Object
net.sf.seaf.util.HashCodeUtils
public class HashCodeUtils
- extends Object
A utility which allows easy implementation of hashCode().
Just pass in the values of the properties which compose the hash code:
public class Person {
String name;
int age;
boolean smoker;
...
public int hashCode() {
return HashCodeUtils.hashCodeFor(name, age, smoker);
}
}
|
Method Summary |
static int |
hashCodeFor(Object... values)
Returns a hash code for an array of values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HashCodeUtils
public HashCodeUtils()
hashCodeFor
public static int hashCodeFor(Object... values)
- Returns a hash code for an array of values.
- Parameters:
values - Object[] of values to be hashed
- Returns:
- int hash code
Copyright © 2008-2011 SEAF. All Rights Reserved.