Example usage for java.util.function IntPredicate test

List of usage examples for java.util.function IntPredicate test

Introduction

In this page you can find the example usage for java.util.function IntPredicate test.

Prototype

boolean test(int value);

Source Link

Document

Evaluates this predicate on the given argument.

Usage

From source file:at.gridtec.lambda4j.function.bi.conversion.BiLongToIntFunction.java

/**
 * Returns a composed {@link BiLongPredicate} 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 BiLongPredicate} 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  a2s . c om*/
 */
@Nonnull
default BiLongPredicate andThenToBoolean(@Nonnull final IntPredicate after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.test(applyAsInt(value1, value2));
}

From source file:at.gridtec.lambda4j.function.bi.conversion.BiDoubleToIntFunction.java

/**
 * Returns a composed {@link BiDoublePredicate} 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 BiDoublePredicate} 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 av a2 s . co  m
 */
@Nonnull
default BiDoublePredicate andThenToBoolean(@Nonnull final IntPredicate after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.test(applyAsInt(value1, value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjIntToIntFunction.java

/**
 * Returns a composed {@link ObjIntPredicate} 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 ObjIntPredicate} 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 ww. j  a va2s .c o m
 */
@Nonnull
default ObjIntPredicate<T> andThenToBoolean(@Nonnull final IntPredicate after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.test(applyAsInt(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjByteToIntFunction.java

/**
 * Returns a composed {@link ObjBytePredicate} 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 ObjBytePredicate} 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 va  2s  .  c o m
 */
@Nonnull
default ObjBytePredicate<T> andThenToBoolean(@Nonnull final IntPredicate after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.test(applyAsInt(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjCharToIntFunction.java

/**
 * Returns a composed {@link ObjCharPredicate} 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 ObjCharPredicate} 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 .  c o m*/
 */
@Nonnull
default ObjCharPredicate<T> andThenToBoolean(@Nonnull final IntPredicate after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.test(applyAsInt(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjFloatToIntFunction.java

/**
 * Returns a composed {@link ObjFloatPredicate} 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 ObjFloatPredicate} 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. com
 */
@Nonnull
default ObjFloatPredicate<T> andThenToBoolean(@Nonnull final IntPredicate after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.test(applyAsInt(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjShortToIntFunction.java

/**
 * Returns a composed {@link ObjShortPredicate} 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 ObjShortPredicate} 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  va2 s . c o m*/
 */
@Nonnull
default ObjShortPredicate<T> andThenToBoolean(@Nonnull final IntPredicate after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.test(applyAsInt(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjBooleanToIntFunction.java

/**
 * Returns a composed {@link ObjBooleanPredicate} 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 ObjBooleanPredicate} 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 . j ava 2s .  c om
 */
@Nonnull
default ObjBooleanPredicate<T> andThenToBoolean(@Nonnull final IntPredicate after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.test(applyAsInt(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjLongToIntFunction.java

/**
 * Returns a composed {@link ObjLongPredicate} 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 ObjLongPredicate} 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  a 2  s . c  o m
 */
@Nonnull
default ObjLongPredicate<T> andThenToBoolean(@Nonnull final IntPredicate after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.test(applyAsInt(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToIntFunction.java

/**
 * Returns a composed {@link ObjDoublePredicate} 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 ObjDoublePredicate} 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 av  a 2  s . com
 */
@Nonnull
default ObjDoublePredicate<T> andThenToBoolean(@Nonnull final IntPredicate after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.test(applyAsInt(t, value));
}