Uses of Interface
org.apache.commons.collections4.Predicate
Package
Description
Interfaces and utilities shared across all packages.
Implementations of the
Collection
interface.Implements the
Iterator
interface.Implements the
List
interface.Implements the
MultiSet
interface.Implements the
Queue
interface.-
Uses of Predicate in org.apache.commons.collections4
Modifier and TypeMethodDescriptionstatic <T> Predicate
<T> PredicateUtils.allPredicate
(Collection<? extends Predicate<? super T>> predicates) Create a new Predicate that returns true only if all of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.allPredicate
(Predicate<? super T>... predicates) Create a new Predicate that returns true only if all of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.andPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Create a new Predicate that returns true only if both of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.anyPredicate
(Collection<? extends Predicate<? super T>> predicates) Create a new Predicate that returns true if any of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.anyPredicate
(Predicate<? super T>... predicates) Create a new Predicate that returns true if any of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.asPredicate
(Transformer<? super T, Boolean> transformer) Create a new Predicate that wraps a Transformer.static <T> Predicate
<T> PredicateUtils.eitherPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Create a new Predicate that returns true if one, but not both, of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.equalPredicate
(T value) Creates a Predicate that checks if the input object is equal to the specified object using equals().static <T> Predicate
<T> PredicateUtils.exceptionPredicate()
Gets a Predicate that always throws an exception.static <T> Predicate
<T> PredicateUtils.falsePredicate()
Gets a Predicate that always returns false.static <T> Predicate
<T> PredicateUtils.identityPredicate
(T value) Creates a Predicate that checks if the input object is equal to the specified object by identity.PredicateUtils.instanceofPredicate
(Class<?> type) Creates a Predicate that checks if the object passed in is of a particular type, using instanceof.static <T> Predicate
<T> PredicateUtils.invokerPredicate
(String methodName) Creates a Predicate that invokes a method on the input object.static <T> Predicate
<T> PredicateUtils.invokerPredicate
(String methodName, Class<?>[] paramTypes, Object[] args) Creates a Predicate that invokes a method on the input object.static <T> Predicate
<T> PredicateUtils.neitherPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Create a new Predicate that returns true if neither of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.nonePredicate
(Collection<? extends Predicate<? super T>> predicates) Create a new Predicate that returns true if none of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.nonePredicate
(Predicate<? super T>... predicates) Create a new Predicate that returns true if none of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.notNullPredicate()
Gets a Predicate that checks if the input object passed in is not null.static <T> Predicate
<T> PredicateUtils.notPredicate
(Predicate<? super T> predicate) Create a new Predicate that returns true if the specified predicate returns false and vice versa.static <T> Predicate
<T> PredicateUtils.nullIsExceptionPredicate
(Predicate<? super T> predicate) Gets a Predicate that throws an exception if the input object is null, otherwise it calls the specified Predicate.static <T> Predicate
<T> PredicateUtils.nullIsFalsePredicate
(Predicate<? super T> predicate) Gets a Predicate that returns false if the input object is null, otherwise it calls the specified Predicate.static <T> Predicate
<T> PredicateUtils.nullIsTruePredicate
(Predicate<? super T> predicate) Gets a Predicate that returns true if the input object is null, otherwise it calls the specified Predicate.static <T> Predicate
<T> PredicateUtils.nullPredicate()
Gets a Predicate that checks if the input object passed in is null.static <T> Predicate
<T> PredicateUtils.onePredicate
(Collection<? extends Predicate<? super T>> predicates) Create a new Predicate that returns true if only one of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.onePredicate
(Predicate<? super T>... predicates) Create a new Predicate that returns true if only one of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.orPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Create a new Predicate that returns true if either of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.transformedPredicate
(Transformer<? super T, ? extends T> transformer, Predicate<? super T> predicate) Creates a predicate that transforms the input object before passing it to the predicate.static <T> Predicate
<T> PredicateUtils.truePredicate()
Gets a Predicate that always returns true.static <T> Predicate
<T> PredicateUtils.uniquePredicate()
Creates a Predicate that returns true the first time an object is encountered, and false if the same object is received again.Modifier and TypeMethodDescriptionboolean
Checks if all elements contained in this iterable are matching the provided predicate.static <T> Predicate
<T> PredicateUtils.allPredicate
(Predicate<? super T>... predicates) Create a new Predicate that returns true only if all of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.andPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Create a new Predicate that returns true only if both of the specified predicates are true.boolean
Checks if this iterable contains any element matching the provided predicate.static <T> Predicate
<T> PredicateUtils.anyPredicate
(Predicate<? super T>... predicates) Create a new Predicate that returns true if any of the specified predicates are true.static <T> Transformer
<T, Boolean> TransformerUtils.asTransformer
(Predicate<? super T> predicate) Creates a Transformer that calls a Predicate each time the transformer is used.static <C> int
CollectionUtils.countMatches
(Iterable<C> input, Predicate<? super C> predicate) Deprecated.static <E> long
IterableUtils.countMatches
(Iterable<E> input, Predicate<? super E> predicate) Counts the number of elements in the input iterable that match the predicate.static <E> Closure
<E> ClosureUtils.doWhileClosure
(Closure<? super E> closure, Predicate<? super E> predicate) Creates a Closure that will call the closure once and then repeatedly until the predicate returns false.static <T> Predicate
<T> PredicateUtils.eitherPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Create a new Predicate that returns true if one, but not both, of the specified predicates are true.static <C> boolean
Deprecated.since 4.1, useIterableUtils.matchesAny(Iterable, Predicate)
insteadstatic <T> boolean
Filter the collection by applying a Predicate to each element.Returns a new FluentIterable whose iterator will only return elements from this iterable matching the provided predicate.static <E> Iterable
<E> IterableUtils.filteredIterable
(Iterable<E> iterable, Predicate<? super E> predicate) Returns a view of the given iterable that only contains elements matching the provided predicate.static <E> Iterator
<E> IteratorUtils.filteredIterator
(Iterator<? extends E> iterator, Predicate<? super E> predicate) Gets an iterator that filters another iterator.static <E> ListIterator
<E> IteratorUtils.filteredListIterator
(ListIterator<? extends E> listIterator, Predicate<? super E> predicate) Gets a list iterator that filters another list iterator.static <T> boolean
CollectionUtils.filterInverse
(Iterable<T> collection, Predicate<? super T> predicate) Filter the collection by applying a Predicate to each element.static <T> T
Deprecated.since 4.1, useIterableUtils.find(Iterable, Predicate)
insteadstatic <E> E
Finds the first element in the given iterable which matches the given predicate.static <E> E
Finds the first element in the given iterator which matches the given predicate.static <E> Closure
<E> Create a new Closure that calls another closure based on the result of the specified predicate.static <E> Closure
<E> ClosureUtils.ifClosure
(Predicate<? super E> predicate, Closure<? super E> trueClosure, Closure<? super E> falseClosure) Create a new Closure that calls one of two closures depending on the specified predicate.static <I,
O> Transformer <I, O> TransformerUtils.ifTransformer
(Predicate<? super I> predicate, Transformer<? super I, ? extends O> trueTransformer, Transformer<? super I, ? extends O> falseTransformer) Create a new Transformer that calls one of two transformers depending on the specified predicate.static <T> Transformer
<T, T> TransformerUtils.ifTransformer
(Predicate<? super T> predicate, Transformer<? super T, ? extends T> trueTransformer) Create a new Transformer that calls the transformer if the predicate is true, otherwise the input object is returned unchanged.static <E> int
Returns the index of the first element in the specified iterable that matches the given predicate.static <E> int
Returns the index of the first element in the specified iterator that matches the given predicate.static <E> int
Finds the first index in the given List which matches the given predicate.static <C> boolean
CollectionUtils.matchesAll
(Iterable<C> input, Predicate<? super C> predicate) Deprecated.since 4.1, useIterableUtils.matchesAll(Iterable, Predicate)
insteadstatic <E> boolean
IterableUtils.matchesAll
(Iterable<E> iterable, Predicate<? super E> predicate) Answers true if a predicate is true for every element of an iterable.static <E> boolean
IteratorUtils.matchesAll
(Iterator<E> iterator, Predicate<? super E> predicate) Answers true if a predicate is true for every element of an iterator.static <E> boolean
IterableUtils.matchesAny
(Iterable<E> iterable, Predicate<? super E> predicate) Answers true if a predicate is true for any element of the iterable.static <E> boolean
IteratorUtils.matchesAny
(Iterator<E> iterator, Predicate<? super E> predicate) Answers true if a predicate is true for any element of the iterator.static <T> Predicate
<T> PredicateUtils.neitherPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Create a new Predicate that returns true if neither of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.nonePredicate
(Predicate<? super T>... predicates) Create a new Predicate that returns true if none of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.notPredicate
(Predicate<? super T> predicate) Create a new Predicate that returns true if the specified predicate returns false and vice versa.static <T> Predicate
<T> PredicateUtils.nullIsExceptionPredicate
(Predicate<? super T> predicate) Gets a Predicate that throws an exception if the input object is null, otherwise it calls the specified Predicate.static <T> Predicate
<T> PredicateUtils.nullIsFalsePredicate
(Predicate<? super T> predicate) Gets a Predicate that returns false if the input object is null, otherwise it calls the specified Predicate.static <T> Predicate
<T> PredicateUtils.nullIsTruePredicate
(Predicate<? super T> predicate) Gets a Predicate that returns true if the input object is null, otherwise it calls the specified Predicate.static <T> Predicate
<T> PredicateUtils.onePredicate
(Predicate<? super T>... predicates) Create a new Predicate that returns true if only one of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.orPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Create a new Predicate that returns true if either of the specified predicates are true.static <O,
R extends Collection<O>>
List<R> IterableUtils.partition
(Iterable<? extends O> iterable, Factory<R> partitionFactory, Predicate<? super O>... predicates) Partitions all elements from iterable into separate output collections, based on the evaluation of the given predicates.Partitions all elements from iterable into separate output collections, based on the evaluation of the given predicate.Partitions all elements from iterable into separate output collections, based on the evaluation of the given predicates.static <E> Bag
<E> BagUtils.predicatedBag
(Bag<E> bag, Predicate<? super E> predicate) Returns a predicated (validating) bag backed by the given bag.static <C> Collection
<C> CollectionUtils.predicatedCollection
(Collection<C> collection, Predicate<? super C> predicate) Returns a predicated (validating) collection backed by the given collection.static <E> List
<E> ListUtils.predicatedList
(List<E> list, Predicate<E> predicate) Returns a predicated (validating) list backed by the given list.static <K,
V> IterableMap <K, V> MapUtils.predicatedMap
(Map<K, V> map, Predicate<? super K> keyPred, Predicate<? super V> valuePred) Returns a predicated (validating) map backed by the given map.static <E> MultiSet
<E> MultiSetUtils.predicatedMultiSet
(MultiSet<E> multiset, Predicate<? super E> predicate) Returns a predicated (validating) multiset backed by the given multiset.static <E> SortedSet
<E> SetUtils.predicatedNavigableSet
(NavigableSet<E> set, Predicate<? super E> predicate) Returns a predicated (validating) navigable set backed by the given navigable set.static <E> Queue
<E> QueueUtils.predicatedQueue
(Queue<E> queue, Predicate<? super E> predicate) Returns a predicated (validating) queue backed by the given queue.static <E> Set
<E> SetUtils.predicatedSet
(Set<E> set, Predicate<? super E> predicate) Returns a predicated (validating) set backed by the given set.static <E> SortedBag
<E> BagUtils.predicatedSortedBag
(SortedBag<E> bag, Predicate<? super E> predicate) Returns a predicated (validating) sorted bag backed by the given sorted bag.static <K,
V> SortedMap <K, V> MapUtils.predicatedSortedMap
(SortedMap<K, V> map, Predicate<? super K> keyPred, Predicate<? super V> valuePred) Returns a predicated (validating) sorted map backed by the given map.static <E> SortedSet
<E> SetUtils.predicatedSortedSet
(SortedSet<E> set, Predicate<? super E> predicate) Returns a predicated (validating) sorted set backed by the given sorted set.static <O> Collection
<O> Selects all elements from input collection which match the given predicate into an output collection.static <O,
R extends Collection<? super O>>
RCollectionUtils.select
(Iterable<? extends O> inputCollection, Predicate<? super O> predicate, R outputCollection) Selects all elements from input collection which match the given predicate and adds them to outputCollection.static <O,
R extends Collection<? super O>>
RCollectionUtils.select
(Iterable<? extends O> inputCollection, Predicate<? super O> predicate, R outputCollection, R rejectedCollection) Selects all elements from inputCollection into an output and rejected collection, based on the evaluation of the given predicate.static <E> List
<E> ListUtils.select
(Collection<? extends E> inputCollection, Predicate<? super E> predicate) Selects all elements from input collection which match the given predicate into an output list.static <O> Collection
<O> CollectionUtils.selectRejected
(Iterable<? extends O> inputCollection, Predicate<? super O> predicate) Selects all elements from inputCollection which don't match the given predicate into an output collection.static <O,
R extends Collection<? super O>>
RCollectionUtils.selectRejected
(Iterable<? extends O> inputCollection, Predicate<? super O> predicate, R outputCollection) Selects all elements from inputCollection which don't match the given predicate and adds them to outputCollection.static <E> List
<E> ListUtils.selectRejected
(Collection<? extends E> inputCollection, Predicate<? super E> predicate) Selects all elements from inputCollection which don't match the given predicate into an output collection.static <O> Collection
<O> Returns a newCollection
containing a minus a subset of b.static <E> Closure
<E> ClosureUtils.switchClosure
(Predicate<? super E>[] predicates, Closure<? super E>[] closures) Create a new Closure that calls one of the closures depending on the predicates.static <E> Closure
<E> ClosureUtils.switchClosure
(Predicate<? super E>[] predicates, Closure<? super E>[] closures, Closure<? super E> defaultClosure) Create a new Closure that calls one of the closures depending on the predicates.static <I,
O> Transformer <I, O> TransformerUtils.switchTransformer
(Predicate<? super I>[] predicates, Transformer<? super I, ? extends O>[] transformers) Create a new Transformer that calls one of the transformers depending on the predicates.static <I,
O> Transformer <I, O> TransformerUtils.switchTransformer
(Predicate<? super I>[] predicates, Transformer<? super I, ? extends O>[] transformers, Transformer<? super I, ? extends O> defaultTransformer) Create a new Transformer that calls one of the transformers depending on the predicates.static <I,
O> Transformer <I, O> TransformerUtils.switchTransformer
(Predicate<? super I> predicate, Transformer<? super I, ? extends O> trueTransformer, Transformer<? super I, ? extends O> falseTransformer) Deprecated.static <T> Predicate
<T> PredicateUtils.transformedPredicate
(Transformer<? super T, ? extends T> transformer, Predicate<? super T> predicate) Creates a predicate that transforms the input object before passing it to the predicate.static <E> Closure
<E> ClosureUtils.whileClosure
(Predicate<? super E> predicate, Closure<? super E> closure) Creates a Closure that will call the closure repeatedly until the predicate returns false.Modifier and TypeMethodDescriptionstatic <T> Predicate
<T> PredicateUtils.allPredicate
(Collection<? extends Predicate<? super T>> predicates) Create a new Predicate that returns true only if all of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.anyPredicate
(Collection<? extends Predicate<? super T>> predicates) Create a new Predicate that returns true if any of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.nonePredicate
(Collection<? extends Predicate<? super T>> predicates) Create a new Predicate that returns true if none of the specified predicates are true.static <T> Predicate
<T> PredicateUtils.onePredicate
(Collection<? extends Predicate<? super T>> predicates) Create a new Predicate that returns true if only one of the specified predicates are true.static <E> Closure
<E> ClosureUtils.switchClosure
(Map<Predicate<E>, Closure<E>> predicatesAndClosures) Create a new Closure that calls one of the closures depending on the predicates.static <I,
O> Transformer <I, O> TransformerUtils.switchTransformer
(Map<Predicate<I>, Transformer<I, O>> predicatesAndTransformers) Create a new Transformer that calls one of the transformers depending on the predicates. -
Uses of Predicate in org.apache.commons.collections4.bag
Modifier and TypeMethodDescriptionstatic <E> PredicatedBag
<E> PredicatedBag.predicatedBag
(Bag<E> bag, Predicate<? super E> predicate) Factory method to create a predicated (validating) bag.static <E> PredicatedSortedBag
<E> PredicatedSortedBag.predicatedSortedBag
(SortedBag<E> bag, Predicate<? super E> predicate) Factory method to create a predicated (validating) bag.ModifierConstructorDescriptionprotected
PredicatedBag
(Bag<E> bag, Predicate<? super E> predicate) Constructor that wraps (not copies).protected
PredicatedSortedBag
(SortedBag<E> bag, Predicate<? super E> predicate) Constructor that wraps (not copies). -
Uses of Predicate in org.apache.commons.collections4.collection
Modifier and TypeMethodDescriptionstatic <E> PredicatedCollection.Builder
<E> Returns a Builder with the given predicate.static <T> PredicatedCollection
<T> PredicatedCollection.predicatedCollection
(Collection<T> coll, Predicate<? super T> predicate) Factory method to create a predicated (validating) collection.ModifierConstructorDescriptionConstructs a PredicatedCollectionBuilder with the specified Predicate.protected
PredicatedCollection
(Collection<E> collection, Predicate<? super E> predicate) Constructor that wraps (not copies). -
Uses of Predicate in org.apache.commons.collections4.functors
Modifier and TypeInterfaceDescriptioninterface
Defines a predicate that decorates one or more other predicates.Modifier and TypeClassDescriptionclass
Abstract base class for predicates.class
Abstract base class for quantification predicates, e.g.final class
AllPredicate<T>
Predicate implementation that returns true if all the predicates return true.final class
AndPredicate<T>
Predicate implementation that returns true if both the predicates return true.final class
AnyPredicate<T>
Predicate implementation that returns true if any of the predicates return true.class
Predicate that compares the input object with the one stored in the predicate using a comparator.final class
Predicate implementation that returns true if the input is the same object as the one stored in this predicate by equals.final class
Predicate implementation that always throws an exception.final class
Predicate implementation that always returns false.final class
Predicate implementation that returns true if the input is the same object as the one stored in this predicate.final class
Predicate implementation that returns true if the input is an instanceof the type stored in this predicate.final class
Predicate implementation that returns true if none of the predicates return true.final class
Predicate implementation that returns true if the input is not null.final class
NotPredicate<T>
Predicate implementation that returns the opposite of the decorated predicate.final class
Predicate implementation that throws an exception if the input is null.final class
Predicate implementation that returns false if the input is null.final class
Predicate implementation that returns true if the input is null.final class
Predicate implementation that returns true if the input is null.final class
OnePredicate<T>
Predicate implementation that returns true if only one of the predicates return true.final class
OrPredicate<T>
Predicate implementation that returns true if either of the predicates return true.final class
Predicate implementation that transforms the given object before invoking anotherPredicate
.final class
Predicate implementation that returns the result of a transformer.final class
Predicate implementation that always returns true.final class
Predicate implementation that returns true the first time an object is passed into the predicate.Modifier and TypeFieldDescriptionstatic final Predicate
ExceptionPredicate.INSTANCE
Singleton predicate instancestatic final Predicate
FalsePredicate.INSTANCE
Singleton predicate instancestatic final Predicate
NotNullPredicate.INSTANCE
Singleton predicate instancestatic final Predicate
NullPredicate.INSTANCE
Singleton predicate instancestatic final Predicate
TruePredicate.INSTANCE
Singleton predicate instanceAbstractQuantifierPredicate.iPredicates
The array of predicates to callModifier and TypeMethodDescriptionstatic <T> Predicate
<T> AllPredicate.allPredicate
(Collection<? extends Predicate<? super T>> predicates) Creates the predicate.static <T> Predicate
<T> AllPredicate.allPredicate
(Predicate<? super T>... predicates) Creates the predicate.static <T> Predicate
<T> AndPredicate.andPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Creates the predicate.static <T> Predicate
<T> AnyPredicate.anyPredicate
(Collection<? extends Predicate<? super T>> predicates) Creates the predicate.static <T> Predicate
<T> AnyPredicate.anyPredicate
(Predicate<? super T>... predicates) Creates the predicate.static <T> Predicate
<T> ComparatorPredicate.comparatorPredicate
(T object, Comparator<T> comparator) Creates the comparator predicatestatic <T> Predicate
<T> ComparatorPredicate.comparatorPredicate
(T object, Comparator<T> comparator, ComparatorPredicate.Criterion criterion) Creates the comparator predicatestatic <T> Predicate
<T> EqualPredicate.equalPredicate
(T object) Creates the predicate.static <T> Predicate
<T> EqualPredicate.equalPredicate
(T object, Equator<T> equator) Creates the identity predicate.static <T> Predicate
<T> ExceptionPredicate.exceptionPredicate()
Factory returning the singleton instance.static <T> Predicate
<T> FalsePredicate.falsePredicate()
Gets a typed instance.IfClosure.getPredicate()
Gets the predicate.IfTransformer.getPredicate()
Gets the predicate.PredicateTransformer.getPredicate()
Gets the predicate.WhileClosure.getPredicate()
Gets the predicate in use.AbstractQuantifierPredicate.getPredicates()
Gets the predicates.AndPredicate.getPredicates()
Gets the two predicates being decorated as an array.NotPredicate.getPredicates()
Gets the predicate being decorated.NullIsExceptionPredicate.getPredicates()
Gets the predicate being decorated.NullIsFalsePredicate.getPredicates()
Gets the predicate being decorated.NullIsTruePredicate.getPredicates()
Gets the predicate being decorated.OrPredicate.getPredicates()
Gets the two predicates being decorated as an array.PredicateDecorator.getPredicates()
Gets the predicates being decorated as an array.SwitchClosure.getPredicates()
Gets the predicates.SwitchTransformer.getPredicates()
Gets the predicates.TransformedPredicate.getPredicates()
Gets the predicate being decorated.static <T> Predicate
<T> IdentityPredicate.identityPredicate
(T object) Creates the identity predicate.InstanceofPredicate.instanceOfPredicate
(Class<?> type) Creates the identity predicate.static <T> Predicate
<T> NonePredicate.nonePredicate
(Collection<? extends Predicate<? super T>> predicates) Creates the predicate.static <T> Predicate
<T> NonePredicate.nonePredicate
(Predicate<? super T>... predicates) Creates the predicate.static <T> Predicate
<T> NotNullPredicate.notNullPredicate()
Factory returning the singleton instance.static <T> Predicate
<T> NotPredicate.notPredicate
(Predicate<? super T> predicate) Creates the not predicate.static <T> Predicate
<T> NullIsExceptionPredicate.nullIsExceptionPredicate
(Predicate<? super T> predicate) Creates the null exception predicate.static <T> Predicate
<T> NullIsFalsePredicate.nullIsFalsePredicate
(Predicate<? super T> predicate) Creates the null false predicate.static <T> Predicate
<T> NullIsTruePredicate.nullIsTruePredicate
(Predicate<? super T> predicate) Creates the null true predicate.static <T> Predicate
<T> NullPredicate.nullPredicate()
Factory returning the singleton instance.static <T> Predicate
<T> OnePredicate.onePredicate
(Collection<? extends Predicate<? super T>> predicates) Creates the predicate.static <T> Predicate
<T> OnePredicate.onePredicate
(Predicate<? super T>... predicates) Creates the predicate.static <T> Predicate
<T> OrPredicate.orPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Creates the predicate.static <T> Predicate
<T> TransformedPredicate.transformedPredicate
(Transformer<? super T, ? extends T> transformer, Predicate<? super T> predicate) Creates the predicate.static <T> Predicate
<T> TransformerPredicate.transformerPredicate
(Transformer<? super T, Boolean> transformer) Creates the predicate.static <T> Predicate
<T> TruePredicate.truePredicate()
Factory returning the singleton instance.static <T> Predicate
<T> UniquePredicate.uniquePredicate()
Creates the predicate.Modifier and TypeMethodDescriptionstatic <T> Predicate
<T> AllPredicate.allPredicate
(Predicate<? super T>... predicates) Creates the predicate.static <T> Predicate
<T> AndPredicate.andPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Creates the predicate.static <T> Predicate
<T> AnyPredicate.anyPredicate
(Predicate<? super T>... predicates) Creates the predicate.static <E> Closure
<E> Factory method that performs validation.static <E> Closure
<E> IfClosure.ifClosure
(Predicate<? super E> predicate, Closure<? super E> trueClosure, Closure<? super E> falseClosure) Factory method that performs validation.static <I,
O> Transformer <I, O> IfTransformer.ifTransformer
(Predicate<? super I> predicate, Transformer<? super I, ? extends O> trueTransformer, Transformer<? super I, ? extends O> falseTransformer) Factory method that performs validation.static <T> Transformer
<T, T> IfTransformer.ifTransformer
(Predicate<? super T> predicate, Transformer<? super T, ? extends T> trueTransformer) Factory method that performs validation.static <T> Predicate
<T> NonePredicate.nonePredicate
(Predicate<? super T>... predicates) Creates the predicate.static <T> Predicate
<T> NotPredicate.notPredicate
(Predicate<? super T> predicate) Creates the not predicate.static <T> Predicate
<T> NullIsExceptionPredicate.nullIsExceptionPredicate
(Predicate<? super T> predicate) Creates the null exception predicate.static <T> Predicate
<T> NullIsFalsePredicate.nullIsFalsePredicate
(Predicate<? super T> predicate) Creates the null false predicate.static <T> Predicate
<T> NullIsTruePredicate.nullIsTruePredicate
(Predicate<? super T> predicate) Creates the null true predicate.static <T> Predicate
<T> OnePredicate.onePredicate
(Predicate<? super T>... predicates) Creates the predicate.static <T> Predicate
<T> OrPredicate.orPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Creates the predicate.static <T> Transformer
<T, Boolean> PredicateTransformer.predicateTransformer
(Predicate<? super T> predicate) Factory method that performs validation.static <E> Closure
<E> SwitchClosure.switchClosure
(Predicate<? super E>[] predicates, Closure<? super E>[] closures, Closure<? super E> defaultClosure) Factory method that performs validation and copies the parameter arrays.static <I,
O> Transformer <I, O> SwitchTransformer.switchTransformer
(Predicate<? super I>[] predicates, Transformer<? super I, ? extends O>[] transformers, Transformer<? super I, ? extends O> defaultTransformer) Factory method that performs validation and copies the parameter arrays.static <T> Predicate
<T> TransformedPredicate.transformedPredicate
(Transformer<? super T, ? extends T> transformer, Predicate<? super T> predicate) Creates the predicate.static <E> Closure
<E> WhileClosure.whileClosure
(Predicate<? super E> predicate, Closure<? super E> closure, boolean doLoop) Factory method that performs validation.Modifier and TypeMethodDescriptionstatic <T> Predicate
<T> AllPredicate.allPredicate
(Collection<? extends Predicate<? super T>> predicates) Creates the predicate.static <T> Predicate
<T> AnyPredicate.anyPredicate
(Collection<? extends Predicate<? super T>> predicates) Creates the predicate.static <T> Predicate
<T> NonePredicate.nonePredicate
(Collection<? extends Predicate<? super T>> predicates) Creates the predicate.static <T> Predicate
<T> OnePredicate.onePredicate
(Collection<? extends Predicate<? super T>> predicates) Creates the predicate.static <E> Closure
<E> SwitchClosure.switchClosure
(Map<Predicate<E>, Closure<E>> predicatesAndClosures) Create a new Closure that calls one of the closures depending on the predicates.static <I,
O> Transformer <I, O> SwitchTransformer.switchTransformer
(Map<? extends Predicate<? super I>, ? extends Transformer<? super I, ? extends O>> map) Create a new Transformer that calls one of the transformers depending on the predicates.ModifierConstructorDescriptionAbstractQuantifierPredicate
(Predicate<? super T>... predicates) Constructor that performs no validation.AllPredicate
(Predicate<? super T>... predicates) Constructor that performs no validation.AndPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Constructor that performs no validation.AnyPredicate
(Predicate<? super T>... predicates) Constructor that performs no validation.Constructor that performs no validation.IfClosure
(Predicate<? super T> predicate, Closure<? super T> trueClosure, Closure<? super T> falseClosure) Constructor that performs no validation.IfTransformer
(Predicate<? super T> predicate, Transformer<? super T, ? extends R> trueTransformer, Transformer<? super T, ? extends R> falseTransformer) Constructor that performs no validation.NonePredicate
(Predicate<? super T>... predicates) Constructor that performs no validation.NotPredicate
(Predicate<? super T> predicate) Constructor that performs no validation.NullIsExceptionPredicate
(Predicate<? super T> predicate) Constructor that performs no validation.NullIsFalsePredicate
(Predicate<? super T> predicate) Constructor that performs no validation.NullIsTruePredicate
(Predicate<? super T> predicate) Constructor that performs no validation.OnePredicate
(Predicate<? super T>... predicates) Constructor that performs no validation.OrPredicate
(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Constructor that performs no validation.PredicateTransformer
(Predicate<? super T> predicate) Constructor that performs no validation.SwitchClosure
(Predicate<? super T>[] predicates, Closure<? super T>[] closures, Closure<? super T> defaultClosure) Constructor that performs no validation.SwitchTransformer
(Predicate<? super T>[] predicates, Transformer<? super T, ? extends R>[] transformers, Transformer<? super T, ? extends R> defaultTransformer) Constructor that performs no validation.TransformedPredicate
(Transformer<? super T, ? extends T> transformer, Predicate<? super T> predicate) Constructor that performs no validation.WhileClosure
(Predicate<? super T> predicate, Closure<? super T> closure, boolean doLoop) Constructor that performs no validation. -
Uses of Predicate in org.apache.commons.collections4.iterators
Modifier and TypeMethodDescriptionFilterIterator.getPredicate()
Gets the predicate this iterator is using.FilterListIterator.getPredicate()
Gets the predicate this iterator is using.Modifier and TypeMethodDescriptionvoid
FilterIterator.setPredicate
(Predicate<? super E> predicate) Sets the predicate this the iterator to use where null accepts all values.void
FilterListIterator.setPredicate
(Predicate<? super E> predicate) Sets the predicate this the iterator to use.ModifierConstructorDescriptionFilterIterator
(Iterator<? extends E> iterator, Predicate<? super E> predicate) Constructs a newFilterIterator
that will use the given iterator and predicate.FilterListIterator
(ListIterator<? extends E> iterator, Predicate<? super E> predicate) Constructs a newFilterListIterator
.FilterListIterator
(Predicate<? super E> predicate) Constructs a newFilterListIterator
that will not function untilsetListIterator
is invoked. -
Uses of Predicate in org.apache.commons.collections4.list
Modifier and TypeMethodDescriptionstatic <T> PredicatedList
<T> PredicatedList.predicatedList
(List<T> list, Predicate<? super T> predicate) Factory method to create a predicated (validating) list.ModifierConstructorDescriptionprotected
PredicatedList
(List<E> list, Predicate<? super E> predicate) Constructor that wraps (not copies). -
Uses of Predicate in org.apache.commons.collections4.map
Modifier and TypeFieldDescriptionPredicatedMap.keyPredicate
The key predicate to usePredicatedMap.valuePredicate
The value predicate to useModifier and TypeMethodDescriptionstatic <K,
V> PredicatedMap <K, V> PredicatedMap.predicatedMap
(Map<K, V> map, Predicate<? super K> keyPredicate, Predicate<? super V> valuePredicate) Factory method to create a predicated (validating) map.static <K,
V> PredicatedSortedMap <K, V> PredicatedSortedMap.predicatedSortedMap
(SortedMap<K, V> map, Predicate<? super K> keyPredicate, Predicate<? super V> valuePredicate) Factory method to create a predicated (validating) sorted map. -
Uses of Predicate in org.apache.commons.collections4.multiset
Modifier and TypeMethodDescriptionstatic <E> PredicatedMultiSet
<E> PredicatedMultiSet.predicatedMultiSet
(MultiSet<E> multiset, Predicate<? super E> predicate) Factory method to create a predicated (validating) multiset.ModifierConstructorDescriptionprotected
PredicatedMultiSet
(MultiSet<E> multiset, Predicate<? super E> predicate) Constructor that wraps (not copies). -
Uses of Predicate in org.apache.commons.collections4.queue
Modifier and TypeMethodDescriptionstatic <E> PredicatedQueue
<E> PredicatedQueue.predicatedQueue
(Queue<E> Queue, Predicate<? super E> predicate) Factory method to create a predicated (validating) queue.ModifierConstructorDescriptionprotected
PredicatedQueue
(Queue<E> queue, Predicate<? super E> predicate) Constructor that wraps (not copies). -
Uses of Predicate in org.apache.commons.collections4.set
Modifier and TypeMethodDescriptionstatic <E> PredicatedNavigableSet
<E> PredicatedNavigableSet.predicatedNavigableSet
(NavigableSet<E> set, Predicate<? super E> predicate) Factory method to create a predicated (validating) navigable set.static <E> PredicatedSet
<E> PredicatedSet.predicatedSet
(Set<E> set, Predicate<? super E> predicate) Factory method to create a predicated (validating) set.static <E> PredicatedSortedSet
<E> PredicatedSortedSet.predicatedSortedSet
(SortedSet<E> set, Predicate<? super E> predicate) Factory method to create a predicated (validating) sorted set.ModifierConstructorDescriptionprotected
PredicatedNavigableSet
(NavigableSet<E> set, Predicate<? super E> predicate) Constructor that wraps (not copies).protected
PredicatedSet
(Set<E> set, Predicate<? super E> predicate) Constructor that wraps (not copies).protected
PredicatedSortedSet
(SortedSet<E> set, Predicate<? super E> predicate) Constructor that wraps (not copies).
IterableUtils.countMatches(Iterable, Predicate)
instead