Java Utililty Methods Object Hash

List of utility methods to do Object Hash

Description

The list of methods to do Object Hash are organized into topic(s).

Method

intcombineHashesOrdered(Object... objs)
combine Hashes Ordered
return combineHashesOrdered(Arrays.asList(objs));
intdeepHashCode(final Object object)
Returns a hash code for the specified object, which may be an array.
if (object == null) {
    return 0;
if (object instanceof Object[]) {
    return Arrays.deepHashCode((Object[]) object);
if (object instanceof double[]) {
    return Arrays.hashCode((double[]) object);
...
intdeepHashCode(Object o)
Gets hash code of an object, optionally returns hash code based on the "deep contents" of array if the object is an array.
if (o == null) {
    return 0;
if (!o.getClass().isArray()) {
    return o.hashCode();
if (o instanceof Object[]) {
    return Arrays.deepHashCode((Object[]) o);
...
StringgetIdentityAsHex(Object object)
Gets the identity hashcode of the given Object as 8-digit hex-number.
return String.format("%08x", Integer.valueOf(System.identityHashCode(object)));
inthash(Object o)
hash
if (o == null)
    return 0;
return o.hashCode();
inthash(Object... objects)
Generates a hash code for a collection of objects using Arrays#hashCode(Object[]) .
return Arrays.hashCode(objects);
inthash(Object... values)
Generates a hash code for a sequence of input values.
return Arrays.hashCode(values);
inthashCode(final Object o)
hash Code
if (o == null) {
    return NullHashCode;
if (o.getClass().isArray()) {
    if (o instanceof Object[]) {
        return combineHashCodes((Object[]) o);
    if (o instanceof byte[]) {
...
inthashCode(final Object... objects)
Generates a hash code for multiple values.
return Arrays.hashCode(objects);
inthashCode(final Object... objects)
Compute a combined hash code from the supplied objects.
if ((objects == null) || (objects.length == 0)) {
    return 0;
int hc = 0;
for (Object object : objects) {
    hc = PRIME * hc;
    if (object instanceof byte[]) {
        hc += Arrays.hashCode((byte[]) object);
...