List of usage examples for java.util.function Predicate test
boolean test(T t);
From source file:at.gridtec.lambda4j.predicate.tri.obj.BiObjFloatPredicate.java
/** * Creates a {@link BiObjFloatPredicate} which uses the {@code second} parameter of this one as argument for the * given {@link Predicate}./*w w w . ja v a 2 s. co 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 second} parameter of this one * @return Creates a {@code BiObjFloatPredicate} which uses the {@code second} parameter of this one as argument for * the given {@code Predicate}. * @throws NullPointerException If given argument is {@code null} */ @Nonnull static <T, U> BiObjFloatPredicate<T, U> onlySecond(@Nonnull final Predicate<? super U> predicate) { Objects.requireNonNull(predicate); return (t, u, value) -> predicate.test(u); }
From source file:at.gridtec.lambda4j.predicate.tri.obj.BiObjIntPredicate.java
/** * Creates a {@link BiObjIntPredicate} which uses the {@code first} parameter of this one as argument for the given * {@link Predicate}.// ww w. j a v a 2s . co 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 first} parameter of this one * @return Creates a {@code BiObjIntPredicate} which uses the {@code first} parameter of this one as argument for * the given {@code Predicate}. * @throws NullPointerException If given argument is {@code null} */ @Nonnull static <T, U> BiObjIntPredicate<T, U> onlyFirst(@Nonnull final Predicate<? super T> predicate) { Objects.requireNonNull(predicate); return (t, u, value) -> predicate.test(t); }
From source file:at.gridtec.lambda4j.predicate.tri.obj.BiObjIntPredicate.java
/** * Creates a {@link BiObjIntPredicate} which uses the {@code second} parameter of this one as argument for the given * {@link Predicate}.// w w w . j a v a 2 s . co 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 second} parameter of this one * @return Creates a {@code BiObjIntPredicate} which uses the {@code second} parameter of this one as argument for * the given {@code Predicate}. * @throws NullPointerException If given argument is {@code null} */ @Nonnull static <T, U> BiObjIntPredicate<T, U> onlySecond(@Nonnull final Predicate<? super U> predicate) { Objects.requireNonNull(predicate); return (t, u, value) -> predicate.test(u); }
From source file:at.gridtec.lambda4j.predicate.tri.obj.BiObjShortPredicate.java
/** * Creates a {@link BiObjShortPredicate} which uses the {@code first} parameter of this one as argument for the * given {@link Predicate}.//from w w w . jav a 2 s.c om * * @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 first} parameter of this one * @return Creates a {@code BiObjShortPredicate} which uses the {@code first} parameter of this one as argument for * the given {@code Predicate}. * @throws NullPointerException If given argument is {@code null} */ @Nonnull static <T, U> BiObjShortPredicate<T, U> onlyFirst(@Nonnull final Predicate<? super T> predicate) { Objects.requireNonNull(predicate); return (t, u, value) -> predicate.test(t); }
From source file:at.gridtec.lambda4j.predicate.tri.obj.BiObjShortPredicate.java
/** * Creates a {@link BiObjShortPredicate} which uses the {@code second} parameter of this one as argument for the * given {@link Predicate}.//www .j a v a 2 s . co 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 second} parameter of this one * @return Creates a {@code BiObjShortPredicate} which uses the {@code second} parameter of this one as argument for * the given {@code Predicate}. * @throws NullPointerException If given argument is {@code null} */ @Nonnull static <T, U> BiObjShortPredicate<T, U> onlySecond(@Nonnull final Predicate<? super U> predicate) { Objects.requireNonNull(predicate); return (t, u, value) -> predicate.test(u); }
From source file:at.gridtec.lambda4j.predicate.tri.obj.BiObjDoublePredicate.java
/** * Creates a {@link BiObjDoublePredicate} which uses the {@code first} parameter of this one as argument for the * given {@link Predicate}./*from ww w .ja va 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 first} parameter of this one * @return Creates a {@code BiObjDoublePredicate} which uses the {@code first} parameter of this one as argument for * the given {@code Predicate}. * @throws NullPointerException If given argument is {@code null} */ @Nonnull static <T, U> BiObjDoublePredicate<T, U> onlyFirst(@Nonnull final Predicate<? super T> predicate) { Objects.requireNonNull(predicate); return (t, u, value) -> predicate.test(t); }
From source file:at.gridtec.lambda4j.predicate.tri.obj.BiObjDoublePredicate.java
/** * Creates a {@link BiObjDoublePredicate} which uses the {@code second} parameter of this one as argument for the * given {@link Predicate}.//from ww w . j av a 2 s . c om * * @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 second} parameter of this one * @return Creates a {@code BiObjDoublePredicate} which uses the {@code second} parameter of this one as argument * for the given {@code Predicate}. * @throws NullPointerException If given argument is {@code null} */ @Nonnull static <T, U> BiObjDoublePredicate<T, U> onlySecond(@Nonnull final Predicate<? super U> predicate) { Objects.requireNonNull(predicate); return (t, u, value) -> predicate.test(u); }
From source file:at.gridtec.lambda4j.predicate.tri.obj.BiObjLongPredicate.java
/** * Creates a {@link BiObjLongPredicate} which uses the {@code first} parameter of this one as argument for the given * {@link Predicate}./*from w ww . ja va2 s .com*/ * * @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 first} parameter of this one * @return Creates a {@code BiObjLongPredicate} which uses the {@code first} parameter of this one as argument for * the given {@code Predicate}. * @throws NullPointerException If given argument is {@code null} */ @Nonnull static <T, U> BiObjLongPredicate<T, U> onlyFirst(@Nonnull final Predicate<? super T> predicate) { Objects.requireNonNull(predicate); return (t, u, value) -> predicate.test(t); }
From source file:at.gridtec.lambda4j.predicate.tri.obj.BiObjLongPredicate.java
/** * Creates a {@link BiObjLongPredicate} which uses the {@code second} parameter of this one as argument for the * given {@link Predicate}.//from w w w . j a v a2s . c om * * @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 second} parameter of this one * @return Creates a {@code BiObjLongPredicate} which uses the {@code second} parameter of this one as argument for * the given {@code Predicate}. * @throws NullPointerException If given argument is {@code null} */ @Nonnull static <T, U> BiObjLongPredicate<T, U> onlySecond(@Nonnull final Predicate<? super U> predicate) { Objects.requireNonNull(predicate); return (t, u, value) -> predicate.test(u); }
From source file:org.apache.hadoop.hive.metastore.utils.MetaStoreUtils.java
/** * filters a given map with predicate provided. All entries of map whose key matches with * predicate will be removed. Expects map to be modifiable and does the operation on actual map, * so does not return a copy of filtered map. * @param map A map of String key-value pairs * @param predicate Predicate with pattern to filter the map *///from w ww. j av a 2s .c o m public static <T> void filterMapKeys(Map<String, T> map, Predicate<String> predicate) { if (map == null) { return; } map.entrySet().removeIf(entry -> predicate.test(entry.getKey())); }