/** * Returns a composed {@link ObjCharPredicate} that represents a short-circuiting logical XOR of * this predicate and another. Any exceptions thrown during evaluation of either predicate is * relayed to the caller; if evaluation of this {@code ObjCharPredicate} throws an exception, the * {@code other} predicate will not be evaluated. * * @param other A {@code ObjCharPredicate} that will be logically-XORed with this one * @return A composed {@code ObjCharPredicate} that represents the short-circuiting logical XOR of * this predicate and the {@code other} predicate. * @throws NullPointerException If given argument is {@code null} * @see #and(ObjCharPredicate) * @see #or(ObjCharPredicate) */ @Nonnull default ObjCharPredicate<T> xor(@Nonnull final ObjCharPredicate<? super T> other) { Objects.requireNonNull(other); return (t, value) -> test(t, value) ^ other.test(t, value); }
/** * Calls the given {@link ObjCharPredicate} with the given arguments and returns its result. * * @param <T> The type of the first argument to the predicate * @param predicate The predicate to be called * @param t The first argument to the predicate * @param value The second argument to the predicate * @return The result from the given {@code ObjCharPredicate}. * @throws NullPointerException If given argument is {@code null} */ static <T> boolean call(@Nonnull final ObjCharPredicate<? super T> predicate, T t, char value) { Objects.requireNonNull(predicate); return predicate.test(t, value); }