Uses of Interface
com.google.common.base.Predicate

Packages that use 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

    Classes in com.google.common.base that implement Predicate
    Modifier and Type
    Class
    Description
    class 
    Determines a true or false value for any Java char value, just as Predicate does for any Object.
    Methods in com.google.common.base that return Predicate
    Modifier and Type
    Method
    Description
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.alwaysFalse()
    Returns a predicate that always evaluates to false.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.alwaysTrue()
    Returns a predicate that always evaluates to true.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.and(Predicate<? super T>... components)
    Returns a predicate that evaluates to true if each of its components evaluates to true.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.and(Predicate<? super T> first, Predicate<? super T> second)
    Returns a predicate that evaluates to true if both of its components evaluate to true.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.and(Iterable<? extends Predicate<? super T>> components)
    Returns a predicate that evaluates to true if each of its components evaluates to true.
    static <A extends @Nullable Object, B extends @Nullable Object>
    Predicate<A>
    Predicates.compose(Predicate<B> predicate, Function<A,? extends B> function)
    Returns the composition of a function and a predicate.
    Predicates.contains(Pattern pattern)
    Returns a predicate that evaluates to true if the CharSequence being tested contains any match for the given regular expression pattern.
    Predicates.containsPattern(String pattern)
    Returns a predicate that evaluates to true if the CharSequence being tested contains any match for the given regular expression pattern.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.equalTo(T target)
    Returns a predicate that evaluates to true if the object being tested equals() the given target or both are null.
    final Predicate<@Nullable T>
    Equivalence.equivalentTo(T target)
    Returns a predicate that evaluates to true if and only if the input is equivalent to target according to this equivalence relation.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.in(Collection<? extends T> target)
    Returns a predicate that evaluates to true if the object reference being tested is a member of the given collection.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.instanceOf(Class<?> clazz)
    Returns a predicate that evaluates to true if the object being tested is an instance of the given class.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.isNull()
    Returns a predicate that evaluates to true if the object reference being tested is null.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.not(Predicate<T> predicate)
    Returns a predicate that evaluates to true if the given predicate evaluates to false.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.notNull()
    Returns a predicate that evaluates to true if the object reference being tested is not null.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.or(Predicate<? super T>... components)
    Returns a predicate that evaluates to true if any one of its components evaluates to true.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.or(Predicate<? super T> first, Predicate<? super T> second)
    Returns a predicate that evaluates to true if either of its components evaluates to true.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.or(Iterable<? extends Predicate<? super T>> components)
    Returns a predicate that evaluates to true if any one of its components evaluates to true.
    static Predicate<Class<?>>
    Predicates.subtypeOf(Class<?> clazz)
    Returns a predicate that evaluates to true if the class being tested is assignable to (is a subtype of) clazz.
    Methods in com.google.common.base with parameters of type Predicate
    Modifier and Type
    Method
    Description
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.and(Predicate<? super T>... components)
    Returns a predicate that evaluates to true if each of its components evaluates to true.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.and(Predicate<? super T> first, Predicate<? super T> second)
    Returns a predicate that evaluates to true if both of its components evaluate to true.
    static <A extends @Nullable Object, B extends @Nullable Object>
    Predicate<A>
    Predicates.compose(Predicate<B> predicate, Function<A,? extends B> function)
    Returns the composition of a function and a predicate.
    CharMatcher.forPredicate(Predicate<? super Character> predicate)
    Returns a matcher with identical behavior to the given Character-based predicate, but which operates on primitive char instances instead.
    static <T extends @Nullable Object>
    Function<T,Boolean>
    Functions.forPredicate(Predicate<T> predicate)
    Creates a function that returns the same boolean output as the given predicate for all inputs.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.not(Predicate<T> predicate)
    Returns a predicate that evaluates to true if the given predicate evaluates to false.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.or(Predicate<? super T>... components)
    Returns a predicate that evaluates to true if any one of its components evaluates to true.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.or(Predicate<? super T> first, Predicate<? super T> second)
    Returns a predicate that evaluates to true if either of its components evaluates to true.
    Method parameters in com.google.common.base with type arguments of type Predicate
    Modifier and Type
    Method
    Description
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.and(Iterable<? extends Predicate<? super T>> components)
    Returns a predicate that evaluates to true if each of its components evaluates to true.
    static <T extends @Nullable Object>
    Predicate<T>
    Predicates.or(Iterable<? extends Predicate<? super T>> components)
    Returns a predicate that evaluates to true if any one of its components evaluates to true.
  • Uses of Predicate in com.google.common.collect

    Classes in com.google.common.collect that implement Predicate
    Modifier and Type
    Class
    Description
    final class 
    Range<C extends Comparable>
    A range (or "interval") defines the boundaries around a contiguous span of values of some Comparable type; for example, "integers from 1 to 100 inclusive." Note that it is not possible to iterate over these contained values.
    Methods in com.google.common.collect with parameters of type Predicate
    Modifier and Type
    Method
    Description
    static <T extends @Nullable Object>
    boolean
    Iterables.all(Iterable<T> iterable, Predicate<? super T> predicate)
    Returns true if every element in iterable satisfies the predicate.
    static <T extends @Nullable Object>
    boolean
    Iterators.all(Iterator<T> iterator, Predicate<? super T> predicate)
    Returns true if every element returned by iterator satisfies the given predicate.
    final boolean
    FluentIterable.allMatch(Predicate<? super E> predicate)
    Returns true if every element in this fluent iterable satisfies the predicate.
    static <T extends @Nullable Object>
    boolean
    Iterables.any(Iterable<T> iterable, Predicate<? super T> predicate)
    Returns true if any element in iterable satisfies the predicate.
    static <T extends @Nullable Object>
    boolean
    Iterators.any(Iterator<T> iterator, Predicate<? super T> predicate)
    Returns true if one or more elements returned by iterator satisfy the given predicate.
    final boolean
    FluentIterable.anyMatch(Predicate<? super E> predicate)
    Returns true 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 of unfiltered that satisfy a predicate.
    FluentIterable.filter(Predicate<? super E> predicate)
    Returns the elements from this fluent iterable that satisfy a predicate.
    static <T extends @Nullable Object>
    Iterable<T>
    Iterables.filter(Iterable<T> unfiltered, Predicate<? super T> retainIfTrue)
    Returns a view of unfiltered containing all elements that satisfy the input predicate retainIfTrue.
    static <T extends @Nullable Object>
    UnmodifiableIterator<T>
    Iterators.filter(Iterator<T> unfiltered, Predicate<? super T> retainIfTrue)
    Returns a view of unfiltered containing all elements that satisfy the input predicate retainIfTrue.
    static <E extends @Nullable Object>
    Multiset<E>
    Multisets.filter(Multiset<E> unfiltered, Predicate<? super E> predicate)
    Returns a view of the elements of unfiltered that satisfy a predicate.
    static <E extends @Nullable Object>
    NavigableSet<E>
    Sets.filter(NavigableSet<E> unfiltered, Predicate<? super E> predicate)
    Returns the elements of a NavigableSet, unfiltered, that satisfy a predicate.
    static <E extends @Nullable Object>
    Set<E>
    Sets.filter(Set<E> unfiltered, Predicate<? super E> predicate)
    Returns the elements of unfiltered that satisfy a predicate.
    static <E extends @Nullable Object>
    SortedSet<E>
    Sets.filter(SortedSet<E> unfiltered, Predicate<? super E> predicate)
    Returns the elements of a SortedSet, unfiltered, that satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    BiMap<K,V>
    Maps.filterEntries(BiMap<K,V> unfiltered, Predicate<? super Map.Entry<K,V>> entryPredicate)
    Returns a bimap containing the mappings in unfiltered that satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    Map<K,V>
    Maps.filterEntries(Map<K,V> unfiltered, Predicate<? super Map.Entry<K,V>> entryPredicate)
    Returns a map containing the mappings in unfiltered 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 in unfiltered that satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    SortedMap<K,V>
    Maps.filterEntries(SortedMap<K,V> unfiltered, Predicate<? super Map.Entry<K,V>> entryPredicate)
    Returns a sorted map containing the mappings in unfiltered that satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    Multimap<K,V>
    Multimaps.filterEntries(Multimap<K,V> unfiltered, Predicate<? super Map.Entry<K,V>> entryPredicate)
    Returns a multimap containing the mappings in unfiltered 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 in unfiltered that satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    BiMap<K,V>
    Maps.filterKeys(BiMap<K,V> unfiltered, Predicate<? super K> keyPredicate)
    Returns a bimap containing the mappings in unfiltered whose keys satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    Map<K,V>
    Maps.filterKeys(Map<K,V> unfiltered, Predicate<? super K> keyPredicate)
    Returns a map containing the mappings in unfiltered 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 in unfiltered whose keys satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    SortedMap<K,V>
    Maps.filterKeys(SortedMap<K,V> unfiltered, Predicate<? super K> keyPredicate)
    Returns a sorted map containing the mappings in unfiltered 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 in unfiltered whose keys satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    Multimap<K,V>
    Multimaps.filterKeys(Multimap<K,V> unfiltered, Predicate<? super K> keyPredicate)
    Returns a multimap containing the mappings in unfiltered 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 in unfiltered whose keys satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    BiMap<K,V>
    Maps.filterValues(BiMap<K,V> unfiltered, Predicate<? super V> valuePredicate)
    Returns a bimap containing the mappings in unfiltered whose values satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    Map<K,V>
    Maps.filterValues(Map<K,V> unfiltered, Predicate<? super V> valuePredicate)
    Returns a map containing the mappings in unfiltered 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 in unfiltered whose values satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    SortedMap<K,V>
    Maps.filterValues(SortedMap<K,V> unfiltered, Predicate<? super V> valuePredicate)
    Returns a sorted map containing the mappings in unfiltered whose values satisfy a predicate.
    static <K extends @Nullable Object, V extends @Nullable Object>
    Multimap<K,V>
    Multimaps.filterValues(Multimap<K,V> unfiltered, Predicate<? super V> valuePredicate)
    Returns a multimap containing the mappings in unfiltered 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 in unfiltered whose values satisfy a predicate.
    static <T extends @Nullable Object>
    T
    Iterables.find(Iterable<? extends T> iterable, Predicate<? super T> predicate, T defaultValue)
    Returns the first element in iterable that satisfies the given predicate, or defaultValue if none found.
    static <T extends @Nullable Object>
    T
    Iterables.find(Iterable<T> iterable, Predicate<? super T> predicate)
    Returns the first element in iterable that satisfies the given predicate; use this method only when such an element is known to exist.
    static <T extends @Nullable Object>
    T
    Iterators.find(Iterator<? extends T> iterator, Predicate<? super T> predicate, T defaultValue)
    Returns the first element in iterator that satisfies the given predicate.
    static <T extends @Nullable Object>
    T
    Iterators.find(Iterator<T> iterator, Predicate<? super T> predicate)
    Returns the first element in iterator that satisfies the given predicate; use this method only when such an element is known to exist.
    final Optional<@NonNull E>
    FluentIterable.firstMatch(Predicate<? super E> predicate)
    Returns an Optional containing the first element in this fluent iterable that satisfies the given predicate, if such an element exists.
    static <T extends @Nullable Object>
    int
    Iterables.indexOf(Iterable<T> iterable, Predicate<? super T> predicate)
    Returns the index in iterable of the first element that satisfies the provided predicate, or -1 if the Iterable has no such elements.
    static <T extends @Nullable Object>
    int
    Iterators.indexOf(Iterator<T> iterator, Predicate<? super T> predicate)
    Returns the index in iterator of the first element that satisfies the provided predicate, or -1 if the Iterator has no such elements.
    static <T extends @Nullable Object>
    boolean
    Iterables.removeIf(Iterable<T> removeFrom, Predicate<? super T> predicate)
    Removes, from an iterable, every element that satisfies the provided predicate.
    static <T extends @Nullable Object>
    boolean
    Iterators.removeIf(Iterator<T> removeFrom, Predicate<? super T> predicate)
    Removes every element that satisfies the provided predicate from the iterator.
    static <T> Optional<T>
    Iterables.tryFind(Iterable<T> iterable, Predicate<? super T> predicate)
    Returns an Optional containing the first element in iterable that satisfies the given predicate, if such an element exists.
    static <T> Optional<T>
    Iterators.tryFind(Iterator<T> iterator, Predicate<? super T> predicate)
    Returns an Optional containing the first element in iterator that satisfies the given predicate, if such an element exists.
  • Uses of Predicate in com.google.common.hash

    Classes in com.google.common.hash that implement Predicate
    Modifier and Type
    Class
    Description
    final class 
    BloomFilter<T extends @Nullable Object>
    A Bloom filter for instances of T.
  • Uses of Predicate in com.google.common.io

    Methods in com.google.common.io that return Predicate
    Modifier and Type
    Method
    Description
    static Predicate<File>
    Files.isDirectory()
    Returns a predicate that returns the result of File.isDirectory() on input files.
    static Predicate<Path>
    MoreFiles.isDirectory(LinkOption... options)
    Returns a predicate that returns the result of Files.isDirectory(Path, LinkOption...) on input paths with the given link options.
    static Predicate<File>
    Files.isFile()
    Returns a predicate that returns the result of File.isFile() on input files.
    static Predicate<Path>
    MoreFiles.isRegularFile(LinkOption... options)
    Returns a predicate that returns the result of Files.isRegularFile(Path, LinkOption...) on input paths with the given link options.