/** * Factory to create the predicate. * * @param <T> the type that the predicate queries * @param object the object to compare to * @return the predicate */ public static <T> Predicate<T> equalPredicate(final T object) { if (object == null) { return NullPredicate.nullPredicate(); } return new EqualPredicate<>(object); }
/** * Factory to create the identity predicate. * * @param <T> the type that the predicate queries * @param object the object to compare to * @param equator the equator to use for comparison * @return the predicate * @since 4.0 */ public static <T> Predicate<T> equalPredicate(final T object, final Equator<T> equator) { if (object == null) { return NullPredicate.nullPredicate(); } return new EqualPredicate<>(object, equator); }