| Package | Description |
|---|---|
| com.google.common.base |
Basic utility libraries and interfaces.
|
| com.google.common.collect |
This package contains generic collection interfaces and implementations, and other utilities for working with collections.
|
| com.google.common.hash |
Hash functions and related structures.
|
| com.google.common.io |
This package contains utility methods and classes for working with Java I/O; for example input streams, output streams, readers, writers, and files.
|
| Modifier and Type | Class and Description |
|---|---|
class |
CharMatcher
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Predicate |
Predicates.alwaysFalse()
Returns a predicate that always evaluates to
false.
|
static <T> Predicate |
Predicates.alwaysTrue()
Returns a predicate that always evaluates to
true.
|
static <T> Predicate |
Predicates.and(Iterable
Returns a predicate that evaluates to
true if each of its components evaluates to
true.
|
static <T> Predicate |
Predicates.and(Predicate
Returns a predicate that evaluates to
true if each of its components evaluates to
true.
|
static <T> Predicate |
Predicates.and(Predicate
Returns a predicate that evaluates to
true if both of its components evaluate to
true.
|
static Predicate |
Predicates.assignableFrom(Class
Returns a predicate that evaluates to
true if the class being tested is assignable from the given class.
|
static <A |
Predicates.compose(Predicate
Returns the composition of a function and a predicate.
|
static Predicate |
Predicates.contains(Pattern
Returns a predicate that evaluates to
true if the
CharSequence being tested contains any match for the given regular expression pattern.
|
static Predicate |
Predicates.containsPattern(String
Returns a predicate that evaluates to
true if the
CharSequence being tested contains any match for the given regular expression pattern.
|
static <T> Predicate |
Predicates.equalTo(T target)
Returns a predicate that evaluates to
true if the object being tested
equals() the given target or both are null.
|
Predicate |
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> Predicate |
Predicates.in(Collection
Returns a predicate that evaluates to
true if the object reference being tested is a member of the given collection.
|
static Predicate |
Predicates.instanceOf(Class
Returns a predicate that evaluates to
true if the object being tested is an instance of the given class.
|
static <T> Predicate |
Predicates.isNull()
Returns a predicate that evaluates to
true if the object reference being tested is null.
|
static <T> Predicate |
Predicates.not(Predicate
Returns a predicate that evaluates to
true if the given predicate evaluates to
false.
|
static <T> Predicate |
Predicates.notNull()
Returns a predicate that evaluates to
true if the object reference being tested is not null.
|
static <T> Predicate |
Predicates.or(Iterable
Returns a predicate that evaluates to
true if any one of its components evaluates to
true.
|
static <T> Predicate |
Predicates.or(Predicate
Returns a predicate that evaluates to
true if any one of its components evaluates to
true.
|
static <T> Predicate |
Predicates.or(Predicate
Returns a predicate that evaluates to
true if either of its components evaluates to
true.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Predicate |
Predicates.and(Predicate
Returns a predicate that evaluates to
true if each of its components evaluates to
true.
|
static <T> Predicate |
Predicates.and(Predicate
Returns a predicate that evaluates to
true if both of its components evaluate to
true.
|
static <T> Predicate |
Predicates.and(Predicate
Returns a predicate that evaluates to
true if both of its components evaluate to
true.
|
static <A |
Predicates.compose(Predicate
Returns the composition of a function and a predicate.
|
static CharMatcher |
CharMatcher.forPredicate(Predicate
Returns a matcher with identical behavior to the given
Character-based predicate, but which operates on primitive
char instances instead.
|
static <T> Function |
Functions.forPredicate(Predicate
Creates a function that returns the same boolean output as the given predicate for all inputs.
|
static <T> Predicate |
Predicates.not(Predicate
Returns a predicate that evaluates to
true if the given predicate evaluates to
false.
|
static <T> Predicate |
Predicates.or(Predicate
Returns a predicate that evaluates to
true if any one of its components evaluates to
true.
|
static <T> Predicate |
Predicates.or(Predicate
Returns a predicate that evaluates to
true if either of its components evaluates to
true.
|
static <T> Predicate |
Predicates.or(Predicate
Returns a predicate that evaluates to
true if either of its components evaluates to
true.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Predicate |
Predicates.and(Iterable
Returns a predicate that evaluates to
true if each of its components evaluates to
true.
|
static <T> Predicate |
Predicates.or(Iterable
Returns a predicate that evaluates to
true if any one of its components evaluates to
true.
|
| Modifier and Type | Class and Description |
|---|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
Iterables.all(Iterable
Returns
true if every element in
iterable satisfies the predicate.
|
static <T> boolean |
Iterators.all(Iterator
Returns
true if every element returned by
iterator satisfies the given predicate.
|
boolean |
FluentIterable.allMatch(Predicate
Returns
true if every element in this fluent iterable satisfies the predicate.
|
static <T> boolean |
Iterables.any(Iterable
Returns
true if any element in
iterable satisfies the predicate.
|
static <T> boolean |
Iterators.any(Iterator
Returns
true if one or more elements returned by
iterator satisfy the given predicate.
|
boolean |
FluentIterable.anyMatch(Predicate
Returns
true if any element in this fluent iterable satisfies the predicate.
|
static <E> Collection |
Collections2.filter(Collection
Returns the elements of
unfiltered that satisfy a predicate.
|
static <T> Iterable |
Iterables.filter(Iterable
Returns the elements of
unfiltered that satisfy a predicate.
|
static <T> UnmodifiableIterator |
Iterators.filter(Iterator
Returns the elements of
unfiltered that satisfy a predicate.
|
static <E> Multiset |
Multisets.filter(Multiset
Returns a view of the elements of
unfiltered that satisfy a predicate.
|
static <E> NavigableSet |
Sets.filter(NavigableSet
Returns the elements of a
NavigableSet,
unfiltered, that satisfy a predicate.
|
FluentIterable |
FluentIterable.filter(Predicate
Returns the elements from this fluent iterable that satisfy a predicate.
|
static <E> Set |
Sets.filter(Set
Returns the elements of
unfiltered that satisfy a predicate.
|
static <E> SortedSet |
Sets.filter(SortedSet
Returns the elements of a
SortedSet,
unfiltered, that satisfy a predicate.
|
static <K |
Maps.filterEntries(BiMap
Returns a bimap containing the mappings in
unfiltered that satisfy a predicate.
|
static <K |
Maps.filterEntries(Map
Returns a map containing the mappings in
unfiltered that satisfy a predicate.
|
static <K |
Multimaps.filterEntries(Multimap
Returns a multimap containing the mappings in
unfiltered that satisfy a predicate.
|
static <K |
Maps.filterEntries(NavigableMap
Returns a sorted map containing the mappings in
unfiltered that satisfy a predicate.
|
static <K |
Multimaps.filterEntries(SetMultimap
Returns a multimap containing the mappings in
unfiltered that satisfy a predicate.
|
static <K |
Maps.filterEntries(SortedMap
Returns a sorted map containing the mappings in
unfiltered that satisfy a predicate.
|
static <K |
Maps.filterKeys(BiMap
Returns a bimap containing the mappings in
unfiltered whose keys satisfy a predicate.
|
static <K |
Multimaps.filterKeys(ListMultimap
Returns a multimap containing the mappings in
unfiltered whose keys satisfy a predicate.
|
static <K |
Maps.filterKeys(Map
Returns a map containing the mappings in
unfiltered whose keys satisfy a predicate.
|
static <K |
Multimaps.filterKeys(Multimap
Returns a multimap containing the mappings in
unfiltered whose keys satisfy a predicate.
|
static <K |
Maps.filterKeys(NavigableMap
Returns a navigable map containing the mappings in
unfiltered whose keys satisfy a predicate.
|
static <K |
Multimaps.filterKeys(SetMultimap
Returns a multimap containing the mappings in
unfiltered whose keys satisfy a predicate.
|
static <K |
Maps.filterKeys(SortedMap
Returns a sorted map containing the mappings in
unfiltered whose keys satisfy a predicate.
|
static <K |
Maps.filterValues(BiMap
Returns a bimap containing the mappings in
unfiltered whose values satisfy a predicate.
|
static <K |
Maps.filterValues(Map
Returns a map containing the mappings in
unfiltered whose values satisfy a predicate.
|
static <K |
Multimaps.filterValues(Multimap
Returns a multimap containing the mappings in
unfiltered whose values satisfy a predicate.
|
static <K |
Maps.filterValues(NavigableMap
Returns a navigable map containing the mappings in
unfiltered whose values satisfy a predicate.
|
static <K |
Multimaps.filterValues(SetMultimap
Returns a multimap containing the mappings in
unfiltered whose values satisfy a predicate.
|
static <K |
Maps.filterValues(SortedMap
Returns a sorted map containing the mappings in
unfiltered whose values satisfy a predicate.
|
static <T> T |
Iterables.find(Iterable
Returns the first element in
iterable that satisfies the given predicate, or
defaultValue if none found.
|
static <T> T |
Iterables.find(Iterable
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> T |
Iterators.find(Iterator
Returns the first element in
iterator that satisfies the given predicate.
|
static <T> T |
Iterators.find(Iterator
Returns the first element in
iterator that satisfies the given predicate; use this method only when such an element is known to exist.
|
Optional |
FluentIterable.firstMatch(Predicate
Returns an
Optional containing the first element in this fluent iterable that satisfies the given predicate, if such an element exists.
|
static <T> int |
Iterables.indexOf(Iterable
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> int |
Iterators.indexOf(Iterator
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> boolean |
Iterables.removeIf(Iterable
Removes, from an iterable, every element that satisfies the provided predicate.
|
static <T> boolean |
Iterators.removeIf(Iterator
Removes every element that satisfies the provided predicate from the iterator.
|
static <T> Optional |
Iterables.tryFind(Iterable
Returns an
Optional containing the first element in
iterable that satisfies the given predicate, if such an element exists.
|
static <T> Optional |
Iterators.tryFind(Iterator
Returns an
Optional containing the first element in
iterator that satisfies the given predicate, if such an element exists.
|
| Modifier and Type | Class and Description |
|---|---|
class |
BloomFilter<T>
A Bloom filter for instances of
T.
|
| Modifier and Type | Method and Description |
|---|---|
static Predicate |
Files.isDirectory()
Returns a predicate that returns the result of
File on input files.
|
static Predicate |
Files.isFile()
Returns a predicate that returns the result of
File on input files.
|