Example usage for java.util.function LongPredicate test

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

Introduction

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

Prototype

boolean test(long value);

Source Link

Document

Evaluates this predicate on the given argument.

Usage

From source file:Main.java

public static void main(String[] args) {
    LongPredicate i = (l) -> l > 0;

    System.out.println(i.test(Long.MAX_VALUE));
}

From source file:at.gridtec.lambda4j.predicate.bi.BiLongPredicate.java

/**
 * Creates a {@link BiLongPredicate} which uses the {@code first} parameter of this one as argument for the given
 * {@link LongPredicate}./*w  ww . ja  va  2  s  .c o  m*/
 *
 * @param predicate The predicate which accepts the {@code first} parameter of this one
 * @return Creates a {@code BiLongPredicate} which uses the {@code first} parameter of this one as argument for the
 * given {@code LongPredicate}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static BiLongPredicate onlyFirst(@Nonnull final LongPredicate predicate) {
    Objects.requireNonNull(predicate);
    return (value1, value2) -> predicate.test(value1);
}

From source file:at.gridtec.lambda4j.predicate.bi.BiLongPredicate.java

/**
 * Creates a {@link BiLongPredicate} which uses the {@code second} parameter of this one as argument for the given
 * {@link LongPredicate}./*from   w w w .j av a2  s.  co  m*/
 *
 * @param predicate The predicate which accepts the {@code second} parameter of this one
 * @return Creates a {@code BiLongPredicate} which uses the {@code second} parameter of this one as argument for the
 * given {@code LongPredicate}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static BiLongPredicate onlySecond(@Nonnull final LongPredicate predicate) {
    Objects.requireNonNull(predicate);
    return (value1, value2) -> predicate.test(value2);
}

From source file:at.gridtec.lambda4j.predicate.bi.obj.ObjLongPredicate.java

/**
 * Creates a {@link ObjLongPredicate} which uses the {@code second} parameter of this one as argument for the given
 * {@link LongPredicate}.//ww  w . j av  a2  s.  c o m
 *
 * @param <T> The type of the first argument to the predicate
 * @param predicate The predicate which accepts the {@code second} parameter of this one
 * @return Creates a {@code ObjLongPredicate} which uses the {@code second} parameter of this one as argument for
 * the given {@code LongPredicate}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjLongPredicate<T> onlySecond(@Nonnull final LongPredicate predicate) {
    Objects.requireNonNull(predicate);
    return (t, value) -> predicate.test(value);
}

From source file:at.gridtec.lambda4j.predicate.tri.TriLongPredicate.java

/**
 * Creates a {@link TriLongPredicate} which uses the {@code first} parameter of this one as argument for the given
 * {@link LongPredicate}./* w w  w.  java  2s .  co  m*/
 *
 * @param predicate The predicate which accepts the {@code first} parameter of this one
 * @return Creates a {@code TriLongPredicate} which uses the {@code first} parameter of this one as argument for the
 * given {@code LongPredicate}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static TriLongPredicate onlyFirst(@Nonnull final LongPredicate predicate) {
    Objects.requireNonNull(predicate);
    return (value1, value2, value3) -> predicate.test(value1);
}

From source file:at.gridtec.lambda4j.predicate.tri.TriLongPredicate.java

/**
 * Creates a {@link TriLongPredicate} which uses the {@code second} parameter of this one as argument for the given
 * {@link LongPredicate}.//from  www  .j av  a 2s  . c o m
 *
 * @param predicate The predicate which accepts the {@code second} parameter of this one
 * @return Creates a {@code TriLongPredicate} which uses the {@code second} parameter of this one as argument for
 * the given {@code LongPredicate}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static TriLongPredicate onlySecond(@Nonnull final LongPredicate predicate) {
    Objects.requireNonNull(predicate);
    return (value1, value2, value3) -> predicate.test(value2);
}

From source file:at.gridtec.lambda4j.predicate.tri.TriLongPredicate.java

/**
 * Creates a {@link TriLongPredicate} which uses the {@code third} parameter of this one as argument for the given
 * {@link LongPredicate}./* ww  w  .  java2 s  .  co  m*/
 *
 * @param predicate The predicate which accepts the {@code third} parameter of this one
 * @return Creates a {@code TriLongPredicate} which uses the {@code third} parameter of this one as argument for the
 * given {@code LongPredicate}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static TriLongPredicate onlyThird(@Nonnull final LongPredicate predicate) {
    Objects.requireNonNull(predicate);
    return (value1, value2, value3) -> predicate.test(value3);
}

From source file:at.gridtec.lambda4j.predicate.tri.obj.ObjBiLongPredicate.java

/**
 * Creates a {@link ObjBiLongPredicate} which uses the {@code second} parameter of this one as argument for the
 * given {@link LongPredicate}.//from   w  w  w .j a  va  2  s  .c  o m
 *
 * @param <T> The type of the first argument to the predicate
 * @param predicate The predicate which accepts the {@code second} parameter of this one
 * @return Creates a {@code ObjBiLongPredicate} which uses the {@code second} parameter of this one as argument for
 * the given {@code LongPredicate}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBiLongPredicate<T> onlySecond(@Nonnull final LongPredicate predicate) {
    Objects.requireNonNull(predicate);
    return (t, value1, value2) -> predicate.test(value1);
}

From source file:at.gridtec.lambda4j.predicate.tri.obj.ObjBiLongPredicate.java

/**
 * Creates a {@link ObjBiLongPredicate} which uses the {@code third} parameter of this one as argument for the given
 * {@link LongPredicate}./*  w  w  w  . j a v a 2 s.  c om*/
 *
 * @param <T> The type of the first argument to the predicate
 * @param predicate The predicate which accepts the {@code third} parameter of this one
 * @return Creates a {@code ObjBiLongPredicate} which uses the {@code third} parameter of this one as argument for
 * the given {@code LongPredicate}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBiLongPredicate<T> onlyThird(@Nonnull final LongPredicate predicate) {
    Objects.requireNonNull(predicate);
    return (t, value1, value2) -> predicate.test(value2);
}

From source file:at.gridtec.lambda4j.predicate.tri.obj.BiObjLongPredicate.java

/**
 * Creates a {@link BiObjLongPredicate} which uses the {@code third} parameter of this one as argument for the given
 * {@link LongPredicate}.//ww  w .  j a  v a 2 s .c o m
 *
 * @param <T> The type of the first argument to the predicate
 * @param <U> The type of the second argument to the predicate
 * @param predicate The predicate which accepts the {@code third} parameter of this one
 * @return Creates a {@code BiObjLongPredicate} which uses the {@code third} parameter of this one as argument for
 * the given {@code LongPredicate}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T, U> BiObjLongPredicate<T, U> onlyThird(@Nonnull final LongPredicate predicate) {
    Objects.requireNonNull(predicate);
    return (t, u, value) -> predicate.test(value);
}