Return as hash code for the given object; typically the value of Object#hashCode() . If the object is an array, this method will delegate to any of the nullSafeHashCode methods for arrays in this class. If the object is null , this method returns 0. @par
(Object obj)
| 353 | * @see #nullSafeHashCode(short[]) |
| 354 | */ |
| 355 | public static int nullSafeHashCode(Object obj) { |
| 356 | if (obj == null) { |
| 357 | return 0; |
| 358 | } |
| 359 | if (obj.getClass().isArray()) { |
| 360 | if (obj instanceof Object[]) { |
| 361 | return nullSafeHashCode((Object[]) obj); |
| 362 | } |
| 363 | if (obj instanceof boolean[]) { |
| 364 | return nullSafeHashCode((boolean[]) obj); |
| 365 | } |
| 366 | if (obj instanceof byte[]) { |
| 367 | return nullSafeHashCode((byte[]) obj); |
| 368 | } |
| 369 | if (obj instanceof char[]) { |
| 370 | return nullSafeHashCode((char[]) obj); |
| 371 | } |
| 372 | if (obj instanceof double[]) { |
| 373 | return nullSafeHashCode((double[]) obj); |
| 374 | } |
| 375 | if (obj instanceof float[]) { |
| 376 | return nullSafeHashCode((float[]) obj); |
| 377 | } |
| 378 | if (obj instanceof int[]) { |
| 379 | return nullSafeHashCode((int[]) obj); |
| 380 | } |
| 381 | if (obj instanceof long[]) { |
| 382 | return nullSafeHashCode((long[]) obj); |
| 383 | } |
| 384 | if (obj instanceof short[]) { |
| 385 | return nullSafeHashCode((short[]) obj); |
| 386 | } |
| 387 | } |
| 388 | return obj.hashCode(); |
| 389 | } |
| 390 | |
| 391 | /** |
| 392 | * Return a hash code based on the contents of the specified array. |
no test coverage detected