/** * Returns <code>true</code> if given item is in given array, <code>false</code> otherwise. * * @param item the object to look for in arrayOfValues * @param arrayOfValues the array of values * @return <code>true</code> if given item is in given array, <code>false</code> otherwise. */ private static boolean isItemInArray(Object item, Object[] arrayOfValues) { for (Object value : arrayOfValues) if (areEqual(value, item)) return true; return false; }
@Override public int hashCode() { int result = 1; result = HASH_CODE_PRIME * result + hashCodeFor(actual); result = HASH_CODE_PRIME * result + hashCodeFor(expected); return result; }
/** * Returns {@code true} if the given objects are equal or if both objects are {@code null}. * * @param o1 one of the objects to compare. * @param o2 one of the objects to compare. * @return {@code true} if the given objects are equal or if both objects are {@code null}. */ public static boolean areEqual(Object o1, Object o2) { if (o1 == null) { return o2 == null; } if (o1.equals(o2)) { return true; } return areEqualArrays(o1, o2); }
private String typeNames(Class<?>... types) { return Arrays.toString(namesOf(types)); }
/** * Returns true if actual and other are equal based on {@link Objects#areEqual(Object, Object)}, false otherwise. * * @param actual the object to compare to other * @param other the object to compare to actual * @return true if actual and other are equal based on {@link Objects#areEqual(Object, Object)}, false otherwise. */ @Override public boolean areEqual(Object actual, Object other) { return Objects.areEqual(actual, other); }
@Override public int hashCode() { return HASH_CODE_PRIME * hashCodeFor(description); } }
/** * Returns {@code true} if the given objects are equal or if both objects are {@code null}. * * @param o1 one of the objects to compare. * @param o2 one of the objects to compare. * @return {@code true} if the given objects are equal or if both objects are {@code null}. */ public static boolean areEqual(Object o1, Object o2) { if (o1 == null) { return o2 == null; } if (o1.equals(o2)) { return true; } return areEqualArrays(o1, o2); }
protected boolean areEqual(final NUMBER value, final NUMBER other) { return Objects.areEqual(value, other); }
@Override public int hashCode() { int result = 1; result = HASH_CODE_PRIME * result + hashCodeFor(value); return result; }
@Override public int compare(Object actual, Object other) { return areEqual(actual, other) ? 0 : NOT_EQUAL; }
@Override public int hashCode() { return HASH_CODE_PRIME + hashCodeFor(value) + hashCodeFor(args); }
boolean filter(Object propertyValueOfCurrentElement) { return !areEqual(propertyValueOfCurrentElement, filterParameter); }
@Override public int hashCode() { return HASH_CODE_PRIME * hashCodeFor(description); } }
/** * Returns true if actual and other are equal based on {@link Objects#areEqual(Object, Object)}, false otherwise. * * @param actual the object to compare to other * @param other the object to compare to actual * @return true if actual and other are equal based on {@link Objects#areEqual(Object, Object)}, false otherwise. */ @Override public boolean areEqual(Object actual, Object other) { return Objects.areEqual(actual, other); }
@Override public int hashCode() { int result = 1; result = HASH_CODE_PRIME * result + hashCodeFor(actual); result = HASH_CODE_PRIME * result + hashCodeFor(expected); return result; }
/** * Returns <code>true</code> if given item is in given array, <code>false</code> otherwise. * * @param item the object to look for in arrayOfValues * @param arrayOfValues the array of values * @return <code>true</code> if given item is in given array, <code>false</code> otherwise. */ private static boolean isItemInArray(Object item, Object[] arrayOfValues) { for (Object value : arrayOfValues) if (areEqual(value, item)) return true; return false; }
@Override public int hashCode() { int result = 1; result = HASH_CODE_PRIME * result + hashCodeFor(value); return result; }
@Override public int compare(Object actual, Object other) { return areEqual(actual, other) ? 0 : NOT_EQUAL; }
@Override public int hashCode() { return HASH_CODE_PRIME + hashCodeFor(value) + hashCodeFor(args); }