Uses of Interface
com.google.common.base.Predicate
Package
Description
Basic utility libraries and interfaces.
Collection interfaces and implementations, and other utilities for collections.
Hash functions and related structures.
Utility methods and classes for I/O; for example input streams, output streams, readers, writers,
and files.
-
Uses of Predicate in com.google.common.base
Modifier and TypeClassDescriptionclass
Modifier and TypeMethodDescriptionPredicates.alwaysFalse()
Returns a predicate that always evaluates tofalse
.Predicates.alwaysTrue()
Returns a predicate that always evaluates totrue
.Returns a predicate that evaluates totrue
if each of its components evaluates totrue
.Returns a predicate that evaluates totrue
if both of its components evaluate totrue
.Returns a predicate that evaluates totrue
if each of its components evaluates totrue
.Returns the composition of a function and a predicate.static Predicate
<CharSequence> Returns a predicate that evaluates totrue
if theCharSequence
being tested contains any match for the given regular expression pattern.static Predicate
<CharSequence> Predicates.containsPattern
(String pattern) Returns a predicate that evaluates totrue
if theCharSequence
being tested contains any match for the given regular expression pattern.Predicates.equalTo
(T target) Returns a predicate that evaluates totrue
if the object being testedequals()
the given target or both are null.Equivalence.equivalentTo
(@Nullable T target) Returns a predicate that evaluates to true if and only if the input is equivalent totarget
according to this equivalence relation.Predicates.in
(Collection<? extends T> target) Returns a predicate that evaluates totrue
if the object reference being tested is a member of the given collection.Predicates.instanceOf
(Class<?> clazz) Returns a predicate that evaluates totrue
if the object being tested is an instance of the given class.Predicates.isNull()
Returns a predicate that evaluates totrue
if the object reference being tested is null.Returns a predicate that evaluates totrue
if the given predicate evaluates tofalse
.Predicates.notNull()
Returns a predicate that evaluates totrue
if the object reference being tested is not null.Returns a predicate that evaluates totrue
if any one of its components evaluates totrue
.Returns a predicate that evaluates totrue
if either of its components evaluates totrue
.Returns a predicate that evaluates totrue
if any one of its components evaluates totrue
.Returns a predicate that evaluates totrue
if the class being tested is assignable to (is a subtype of)clazz
.Modifier and TypeMethodDescriptionReturns a predicate that evaluates totrue
if each of its components evaluates totrue
.Returns a predicate that evaluates totrue
if both of its components evaluate totrue
.Returns the composition of a function and a predicate.static CharMatcher
CharMatcher.forPredicate
(Predicate<? super Character> predicate) Returns a matcher with identical behavior to the givenCharacter
-based predicate, but which operates on primitivechar
instances instead.Functions.forPredicate
(Predicate<T> predicate) Creates a function that returns the same boolean output as the given predicate for all inputs.Returns a predicate that evaluates totrue
if the given predicate evaluates tofalse
.Returns a predicate that evaluates totrue
if any one of its components evaluates totrue
.Returns a predicate that evaluates totrue
if either of its components evaluates totrue
.Modifier and TypeMethodDescriptionReturns a predicate that evaluates totrue
if each of its components evaluates totrue
.Returns a predicate that evaluates totrue
if any one of its components evaluates totrue
. -
Uses of Predicate in com.google.common.collect
Modifier and TypeClassDescriptionfinal class
Range<C extends Comparable>
A range (or "interval") defines the boundaries around a contiguous span of values of someComparable
type; for example, "integers from 1 to 100 inclusive."Modifier and TypeMethodDescriptionReturnstrue
if every element initerable
satisfies the predicate.Returnstrue
if every element returned byiterator
satisfies the given predicate.final boolean
Returnstrue
if every element in this fluent iterable satisfies the predicate.Returnstrue
if any element initerable
satisfies the predicate.Returnstrue
if one or more elements returned byiterator
satisfy the given predicate.final boolean
Returnstrue
if any element in this fluent iterable satisfies the predicate.static <E extends @Nullable Object>
Collection<E> Collections2.filter
(Collection<E> unfiltered, Predicate<? super E> predicate) Returns the elements ofunfiltered
that satisfy a predicate.final FluentIterable
<E> Returns the elements from this fluent iterable that satisfy a predicate.Returns a view ofunfiltered
containing all elements that satisfy the input predicateretainIfTrue
.static <T extends @Nullable Object>
UnmodifiableIterator<T> Returns a view ofunfiltered
containing all elements that satisfy the input predicateretainIfTrue
.Returns a view of the elements ofunfiltered
that satisfy a predicate.static <E extends @Nullable Object>
NavigableSet<E> Sets.filter
(NavigableSet<E> unfiltered, Predicate<? super E> predicate) Returns the elements of aNavigableSet
,unfiltered
, that satisfy a predicate.Returns the elements ofunfiltered
that satisfy a predicate.Returns the elements of aSortedSet
,unfiltered
, that satisfy a predicate.Maps.filterEntries
(BiMap<K, V> unfiltered, Predicate<? super Map.Entry<K, V>> entryPredicate) Returns a bimap containing the mappings inunfiltered
that satisfy a predicate.Maps.filterEntries
(Map<K, V> unfiltered, Predicate<? super Map.Entry<K, V>> entryPredicate) Returns a map containing the mappings inunfiltered
that satisfy a predicate.static <K extends @Nullable Object,
V extends @Nullable Object>
NavigableMap<K, V> Maps.filterEntries
(NavigableMap<K, V> unfiltered, Predicate<? super Map.Entry<K, V>> entryPredicate) Returns a sorted map containing the mappings inunfiltered
that satisfy a predicate.Maps.filterEntries
(SortedMap<K, V> unfiltered, Predicate<? super Map.Entry<K, V>> entryPredicate) Returns a sorted map containing the mappings inunfiltered
that satisfy a predicate.Multimaps.filterEntries
(Multimap<K, V> unfiltered, Predicate<? super Map.Entry<K, V>> entryPredicate) Returns a multimap containing the mappings inunfiltered
that satisfy a predicate.static <K extends @Nullable Object,
V extends @Nullable Object>
SetMultimap<K, V> Multimaps.filterEntries
(SetMultimap<K, V> unfiltered, Predicate<? super Map.Entry<K, V>> entryPredicate) Returns a multimap containing the mappings inunfiltered
that satisfy a predicate.Maps.filterKeys
(BiMap<K, V> unfiltered, Predicate<? super K> keyPredicate) Returns a bimap containing the mappings inunfiltered
whose keys satisfy a predicate.Maps.filterKeys
(Map<K, V> unfiltered, Predicate<? super K> keyPredicate) Returns a map containing the mappings inunfiltered
whose keys satisfy a predicate.static <K extends @Nullable Object,
V extends @Nullable Object>
NavigableMap<K, V> Maps.filterKeys
(NavigableMap<K, V> unfiltered, Predicate<? super K> keyPredicate) Returns a navigable map containing the mappings inunfiltered
whose keys satisfy a predicate.Maps.filterKeys
(SortedMap<K, V> unfiltered, Predicate<? super K> keyPredicate) Returns a sorted map containing the mappings inunfiltered
whose keys satisfy a predicate.static <K extends @Nullable Object,
V extends @Nullable Object>
ListMultimap<K, V> Multimaps.filterKeys
(ListMultimap<K, V> unfiltered, Predicate<? super K> keyPredicate) Returns a multimap containing the mappings inunfiltered
whose keys satisfy a predicate.Multimaps.filterKeys
(Multimap<K, V> unfiltered, Predicate<? super K> keyPredicate) Returns a multimap containing the mappings inunfiltered
whose keys satisfy a predicate.static <K extends @Nullable Object,
V extends @Nullable Object>
SetMultimap<K, V> Multimaps.filterKeys
(SetMultimap<K, V> unfiltered, Predicate<? super K> keyPredicate) Returns a multimap containing the mappings inunfiltered
whose keys satisfy a predicate.Maps.filterValues
(BiMap<K, V> unfiltered, Predicate<? super V> valuePredicate) Returns a bimap containing the mappings inunfiltered
whose values satisfy a predicate.Maps.filterValues
(Map<K, V> unfiltered, Predicate<? super V> valuePredicate) Returns a map containing the mappings inunfiltered
whose values satisfy a predicate.static <K extends @Nullable Object,
V extends @Nullable Object>
NavigableMap<K, V> Maps.filterValues
(NavigableMap<K, V> unfiltered, Predicate<? super V> valuePredicate) Returns a navigable map containing the mappings inunfiltered
whose values satisfy a predicate.Maps.filterValues
(SortedMap<K, V> unfiltered, Predicate<? super V> valuePredicate) Returns a sorted map containing the mappings inunfiltered
whose values satisfy a predicate.Multimaps.filterValues
(Multimap<K, V> unfiltered, Predicate<? super V> valuePredicate) Returns a multimap containing the mappings inunfiltered
whose values satisfy a predicate.static <K extends @Nullable Object,
V extends @Nullable Object>
SetMultimap<K, V> Multimaps.filterValues
(SetMultimap<K, V> unfiltered, Predicate<? super V> valuePredicate) Returns a multimap containing the mappings inunfiltered
whose values satisfy a predicate.Iterables.find
(Iterable<? extends T> iterable, Predicate<? super T> predicate, @Nullable T defaultValue) Returns the first element initerable
that satisfies the given predicate, ordefaultValue
if none found.Returns the first element initerable
that satisfies the given predicate; use this method only when such an element is known to exist.Iterators.find
(Iterator<? extends T> iterator, Predicate<? super T> predicate, @Nullable T defaultValue) Returns the first element initerator
that satisfies the given predicate.Returns the first element initerator
that satisfies the given predicate; use this method only when such an element is known to exist.FluentIterable.firstMatch
(Predicate<? super E> predicate) Returns anOptional
containing the first element in this fluent iterable that satisfies the given predicate, if such an element exists.Returns the index initerable
of the first element that satisfies the providedpredicate
, or-1
if the Iterable has no such elements.Returns the index initerator
of the first element that satisfies the providedpredicate
, or-1
if the Iterator has no such elements.Removes, from an iterable, every element that satisfies the provided predicate.Removes every element that satisfies the provided predicate from the iterator.static <T> Optional
<T> Returns anOptional
containing the first element initerable
that satisfies the given predicate, if such an element exists.static <T> Optional
<T> Returns anOptional
containing the first element initerator
that satisfies the given predicate, if such an element exists. -
Uses of Predicate in com.google.common.hash
Modifier and TypeClassDescriptionfinal class
BloomFilter<T extends @Nullable Object>
A Bloom filter for instances ofT
. -
Uses of Predicate in com.google.common.io
Modifier and TypeMethodDescriptionFiles.isDirectory()
Returns a predicate that returns the result ofFile.isDirectory()
on input files.MoreFiles.isDirectory
(LinkOption... options) Returns a predicate that returns the result ofFiles.isDirectory(Path, LinkOption...)
on input paths with the given link options.Files.isFile()
Returns a predicate that returns the result ofFile.isFile()
on input files.MoreFiles.isRegularFile
(LinkOption... options) Returns a predicate that returns the result ofFiles.isRegularFile(Path, LinkOption...)
on input paths with the given link options.