Java Object Hash hashCode(Object object)

Here you can find the source of hashCode(Object object)

Description

hash Code

License

Apache License

Declaration

public static int hashCode(Object object) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Arrays;

public class Main {

    public static int hashCode(Object object) {
        if (object == null) {
            return 0;
        } else if (object instanceof Object[]) {
            return Arrays.deepHashCode((Object[]) object);
        } else if (object instanceof int[]) {
            return Arrays.hashCode((int[]) object);
        } else if (object instanceof long[]) {
            return Arrays.hashCode((long[]) object);
        } else if (object instanceof short[]) {
            return Arrays.hashCode((short[]) object);
        } else if (object instanceof byte[]) {
            return Arrays.hashCode((byte[]) object);
        } else if (object instanceof double[]) {
            return Arrays.hashCode((double[]) object);
        } else if (object instanceof float[]) {
            return Arrays.hashCode((float[]) object);
        } else if (object instanceof char[]) {
            return Arrays.hashCode((char[]) object);
        } else if (object instanceof boolean[]) {
            return Arrays.hashCode((boolean[]) object);
        } else {//from   w  w w . j av  a 2s .c  o m
            return object.hashCode();
        }
    }
}

Related

  1. hashCode(final Object... objects)
  2. hashCode(final Object... objects)
  3. hashCode(Object o)
  4. hashCode(Object obj)
  5. hashCode(Object obj)
  6. hashCode(Object... args)
  7. hashCode(Object... objects)
  8. makeHashCode(Object... objects)
  9. safeHashCode(Object o)