List of usage examples for java.util.function LongPredicate test
boolean test(long value);
From source file:at.gridtec.lambda4j.function.bi.to.ToLongBiFunction2.java
/** * Returns a composed {@link BiPredicate2} that first applies this function to its input, and then applies the * {@code after} predicate to the result. If evaluation of either operation throws an exception, it is relayed to * the caller of the composed operation. This method is just convenience, to provide the ability to transform this * primitive function to an operation returning {@code boolean}. * * @param after The predicate to apply after this function is applied * @return A composed {@code BiPredicate2} that first applies this function to its input, and then applies the * {@code after} predicate to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code * boolean}.//from w w w .j a v a 2s.c o m */ @Nonnull default BiPredicate2<T, U> andThenToBoolean(@Nonnull final LongPredicate after) { Objects.requireNonNull(after); return (t, u) -> after.test(applyAsLong(t, u)); }
From source file:at.gridtec.lambda4j.function.tri.to.ToLongTriFunction.java
/** * Returns a composed {@link TriPredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. If evaluation of either operation throws an exception, it is relayed to * the caller of the composed operation. This method is just convenience, to provide the ability to transform this * primitive function to an operation returning {@code boolean}. * * @param after The predicate to apply after this function is applied * @return A composed {@code TriPredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code * boolean}.//from w w w . j a va 2 s . co m */ @Nonnull default TriPredicate<T, U, V> andThenToBoolean(@Nonnull final LongPredicate after) { Objects.requireNonNull(after); return (t, u, v) -> after.test(applyAsLong(t, u, v)); }
From source file:at.gridtec.lambda4j.function.bi.BiBooleanFunction.java
/** * Returns a composed {@link BiLongFunction} that first applies the {@code before} predicates to * its input, and then applies this function to the result. * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation. * This method is just convenience, to provide the ability to execute an operation which accepts {@code long} input, * before this primitive function is executed. * * @param before1 The first predicate to apply before this function is applied * @param before2 The second predicate to apply before this function is applied * @return A composed {@code BiLongFunction} that first applies the {@code before} predicates to its input, and then * applies this function to the result./* w w w. j a va 2 s . c o m*/ * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * long}. */ @Nonnull default BiLongFunction<R> composeFromLong(@Nonnull final LongPredicate before1, @Nonnull final LongPredicate before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> apply(before1.test(value1), before2.test(value2)); }
From source file:at.gridtec.lambda4j.function.bi.obj.ObjBooleanFunction.java
/** * Returns a composed {@link BiLongFunction} that first applies the {@code before} functions to * its input, and then applies this function to the result. * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation. * This method is just convenience, to provide the ability to execute an operation which accepts {@code long} input, * before this primitive function is executed. * * @param before1 The first function to apply before this function is applied * @param before2 The second predicate to apply before this function is applied * @return A composed {@code BiLongFunction} that first applies the {@code before} functions to its input, and then * applies this function to the result./*from w w w . j ava 2 s. c o m*/ * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * long}. */ @Nonnull default BiLongFunction<R> composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongPredicate before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> apply(before1.apply(value1), before2.test(value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiBooleanToLongFunction.java
/** * Returns a composed {@link BooleanBinaryOperator} that first applies this function to its input, and then applies * the {@code after} predicate to the result. If evaluation of either operation throws an exception, it is relayed * to the caller of the composed operation. This method is just convenience, to provide the ability to transform * this primitive function to an operation returning {@code boolean}. * * @param after The predicate to apply after this function is applied * @return A composed {@code BooleanBinaryOperator} that first applies this function to its input, and then applies * the {@code after} predicate to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code * boolean}./*from ww w. j ava 2s . com*/ */ @Nonnull default BooleanBinaryOperator andThenToBoolean(@Nonnull final LongPredicate after) { Objects.requireNonNull(after); return (value1, value2) -> after.test(applyAsLong(value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiByteToLongFunction.java
/** * Returns a composed {@link BiBytePredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. If evaluation of either operation throws an exception, it is relayed to * the caller of the composed operation. This method is just convenience, to provide the ability to transform this * primitive function to an operation returning {@code boolean}. * * @param after The predicate to apply after this function is applied * @return A composed {@code BiBytePredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code * boolean}.//from ww w . j av a2s.co m */ @Nonnull default BiBytePredicate andThenToBoolean(@Nonnull final LongPredicate after) { Objects.requireNonNull(after); return (value1, value2) -> after.test(applyAsLong(value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiCharToLongFunction.java
/** * Returns a composed {@link BiCharPredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. If evaluation of either operation throws an exception, it is relayed to * the caller of the composed operation. This method is just convenience, to provide the ability to transform this * primitive function to an operation returning {@code boolean}. * * @param after The predicate to apply after this function is applied * @return A composed {@code BiCharPredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code * boolean}.// www .j a v a2 s.co m */ @Nonnull default BiCharPredicate andThenToBoolean(@Nonnull final LongPredicate after) { Objects.requireNonNull(after); return (value1, value2) -> after.test(applyAsLong(value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiFloatToLongFunction.java
/** * Returns a composed {@link BiFloatPredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. If evaluation of either operation throws an exception, it is relayed to * the caller of the composed operation. This method is just convenience, to provide the ability to transform this * primitive function to an operation returning {@code boolean}. * * @param after The predicate to apply after this function is applied * @return A composed {@code BiFloatPredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code * boolean}./*from w w w.ja v a2s .co m*/ */ @Nonnull default BiFloatPredicate andThenToBoolean(@Nonnull final LongPredicate after) { Objects.requireNonNull(after); return (value1, value2) -> after.test(applyAsLong(value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiShortToLongFunction.java
/** * Returns a composed {@link BiShortPredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. If evaluation of either operation throws an exception, it is relayed to * the caller of the composed operation. This method is just convenience, to provide the ability to transform this * primitive function to an operation returning {@code boolean}. * * @param after The predicate to apply after this function is applied * @return A composed {@code BiShortPredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code * boolean}.// w w w . jav a 2 s. c o m */ @Nonnull default BiShortPredicate andThenToBoolean(@Nonnull final LongPredicate after) { Objects.requireNonNull(after); return (value1, value2) -> after.test(applyAsLong(value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiIntToLongFunction.java
/** * Returns a composed {@link BiIntPredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. If evaluation of either operation throws an exception, it is relayed to * the caller of the composed operation. This method is just convenience, to provide the ability to transform this * primitive function to an operation returning {@code boolean}. * * @param after The predicate to apply after this function is applied * @return A composed {@code BiIntPredicate} that first applies this function to its input, and then applies the * {@code after} predicate to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to return primitive values. In this case this is {@code * boolean}./* w ww .j a v a 2 s .c o m*/ */ @Nonnull default BiIntPredicate andThenToBoolean(@Nonnull final LongPredicate after) { Objects.requireNonNull(after); return (value1, value2) -> after.test(applyAsLong(value1, value2)); }