public class PredicateTransformer<T> extends Object implements Transformer<T,Boolean>, Serializable
Constructor and Description |
---|
PredicateTransformer(Predicate<? super T> predicate)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
Predicate<? super T> |
getPredicate()
Gets the predicate.
|
static <T> Transformer<T,Boolean> |
predicateTransformer(Predicate<? super T> predicate)
Factory method that performs validation.
|
Boolean |
transform(T input)
Transforms the input to result by calling a predicate.
|
public PredicateTransformer(Predicate<? super T> predicate)
predicateTransformer
if you want that.predicate
- the predicate to call, not nullpublic static <T> Transformer<T,Boolean> predicateTransformer(Predicate<? super T> predicate)
T
- the input typepredicate
- the predicate to call, not nullpredicate
transformerIllegalArgumentException
- if the predicate is nullpublic Boolean transform(T input)
transform
in interface Transformer<T,Boolean>
input
- the input object to transformpublic Predicate<? super T> getPredicate()
Copyright © 2001–2018 The Apache Software Foundation. All rights reserved.