| java.lang.Object | |
| ↳ | org.mybatis.generator.internal.util.HashCodeUtil |
This class is from javapractices.com:
http://www.javapractices.com/Topic28.cjp
Collected methods which allow easy implementation of hashCode.
Example use case:
public int hashCode() {
int result = HashCodeUtil.SEED;
//collect the contributions of various fields
result = HashCodeUtil.hash(result, fPrimitive);
result = HashCodeUtil.hash(result, fObject);
result = HashCodeUtil.hash(result, fArray);
return result;
}
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | SEED | An initial value for a hashCode, to which is added
contributions from fields. |
|||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
booleans.
| |||||||||||
chars.
| |||||||||||
doubles.
| |||||||||||
floats.
| |||||||||||
ints.
| |||||||||||
aObject is a possibly-null object field, and possibly an
array. | |||||||||||
longs.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
An initial value for a hashCode, to which is added
contributions from fields. Using a non-zero value decreases collisons of
hashCode values.
booleans.
chars.
doubles.
floats.
ints.
aObject is a possibly-null object field, and possibly an
array.
If aObject is an array, then each element may be a primitive
or a possibly-null object.
longs.