@Override public final int hashCode() { return (ObjectUtils.nullSafeHashCode(this.key) ^ ObjectUtils.nullSafeHashCode(this.value)); } }
@Override public int hashCode() { int hashCode = ObjectUtils.nullSafeHashCode(this.methodName); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.source); return hashCode; }
/** * Return a hash code derived from the {@code name} property * of this {@code PropertySource} object. */ @Override public int hashCode() { return ObjectUtils.nullSafeHashCode(this.name); }
@Override public int hashCode() { int hashCode = ObjectUtils.nullSafeHashCode(this.notificationListener); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.notificationFilter); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.handback); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.mappedObjectNames); return hashCode; }
/** * Determine whether the hash code of the content of this ValueHolder. * <p>Note that ValueHolder does not implement {@code hashCode} * directly, to allow for multiple ValueHolder instances with the * same content to reside in the same Set. */ private int contentHashCode() { return ObjectUtils.nullSafeHashCode(this.value) * 29 + ObjectUtils.nullSafeHashCode(this.type); }
@Override public int hashCode() { int hashCode = ObjectUtils.nullSafeHashCode(this.getExpression()); hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutDeclarationScope); hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutParameterNames); hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutParameterTypes); return hashCode; }
@Override public int hashCode() { int hashCode = ObjectUtils.nullSafeHashCode(getBeanClassName()); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.scope); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.constructorArgumentValues); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.propertyValues); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.factoryBeanName); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.factoryMethodName); hashCode = 29 * hashCode + super.hashCode(); return hashCode; }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + ObjectUtils.nullSafeHashCode(this.targetRequestPath); result = 31 * result + this.targetRequestParams.hashCode(); return result; }
@Override public int hashCode() { int result = ObjectUtils.nullSafeHashCode(getScheme()); result = 31 * result + ObjectUtils.nullSafeHashCode(this.userInfo); result = 31 * result + ObjectUtils.nullSafeHashCode(this.host); result = 31 * result + ObjectUtils.nullSafeHashCode(this.port); result = 31 * result + this.path.hashCode(); result = 31 * result + this.queryParams.hashCode(); result = 31 * result + ObjectUtils.nullSafeHashCode(getFragment()); return result; }
@Override public int hashCode() { int hashCode = this.beanDefinition.hashCode(); hashCode = 29 * hashCode + this.beanName.hashCode(); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.aliases); return hashCode; }
@Override public int hashCode() { int result = ObjectUtils.nullSafeHashCode(getScheme()); result = 31 * result + ObjectUtils.nullSafeHashCode(this.ssp); result = 31 * result + ObjectUtils.nullSafeHashCode(getFragment()); return result; }
@Override public int hashCode() { int result = (isCaseSensitiveName() ? this.name : this.name.toLowerCase()).hashCode(); result = 31 * result + ObjectUtils.nullSafeHashCode(this.value); result = 31 * result + (this.isNegated ? 1 : 0); return result; }
@Override public int hashCode() { int hashCode = getBeanClass().hashCode(); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(getReadMethod()); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(getWriteMethod()); return hashCode; }
@Override public int hashCode() { int hashCode = super.hashCode(); hashCode = 29 * hashCode + getField().hashCode(); hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(getRejectedValue()); hashCode = 29 * hashCode + (isBindingFailure() ? 1 : 0); return hashCode; }
@Test public void nullSafeHashCodeWithBooleanArray() { int expected = 31 * 7 + Boolean.TRUE.hashCode(); expected = 31 * expected + Boolean.FALSE.hashCode(); boolean[] array = {true, false}; int actual = ObjectUtils.nullSafeHashCode(array); assertEquals(expected, actual); }
@Test public void nullSafeHashCodeWithDoubleArray() { long bits = Double.doubleToLongBits(8449.65); int expected = 31 * 7 + (int) (bits ^ (bits >>> 32)); bits = Double.doubleToLongBits(9944.923); expected = 31 * expected + (int) (bits ^ (bits >>> 32)); double[] array = {8449.65, 9944.923}; int actual = ObjectUtils.nullSafeHashCode(array); assertEquals(expected, actual); }
@Test public void nullSafeHashCodeWithObjectArray() { int expected = 31 * 7 + "Leia".hashCode(); expected = 31 * expected + "Han".hashCode(); Object[] array = {"Leia", "Han"}; int actual = ObjectUtils.nullSafeHashCode(array); assertEquals(expected, actual); }
private void assertEqualHashCodes(int expected, Object array) { int actual = ObjectUtils.nullSafeHashCode(array); assertEquals(expected, actual); assertTrue(array.hashCode() != actual); }
@Test public void nullSafeHashCodeWithShortArray() { int expected = 31 * 7 + 70; expected = 31 * expected + 8; short[] array = {70, 8}; int actual = ObjectUtils.nullSafeHashCode(array); assertEquals(expected, actual); }
@Test public void nullSafeHashCodeWithObjectBeingFloatArray() { Object array = new float[] {9.9f, 9.54f}; int expected = ObjectUtils.nullSafeHashCode((float[]) array); assertEqualHashCodes(expected, array); }