| Package | Description |
|---|---|
| com.google.common.base |
Basic utility libraries and interfaces.
|
| com.google.common.cache |
This package contains caching utilities.
|
| com.google.common.collect |
This package contains generic collection interfaces and implementations, and other utilities for working with collections.
|
| com.google.common.escape |
Interfaces, utilities, and simple implementations of escapers and encoders.
|
| com.google.common.util.concurrent |
Concurrency utilities.
|
| Modifier and Type | Class and Description |
|---|---|
class |
Converter<A
A function from
A to
B with an associated
reverse function from
B to
A; used for converting back and forth between
different representations of the same information.
|
| Modifier and Type | Method and Description |
|---|---|
static <A |
Functions.compose(Function
Returns the composition of two functions.
|
static <E> Function |
Functions.constant(E value)
Creates a function that returns
value for any input.
|
static <K |
Functions.forMap(Map
Returns a function which performs a map lookup with a default value.
|
static <K |
Functions.forMap(Map
Returns a function which performs a map lookup.
|
static <T> Function |
Functions.forPredicate(Predicate
Creates a function that returns the same boolean output as the given predicate for all inputs.
|
static <T> Function |
Functions.forSupplier(Supplier
Returns a function that always returns the result of invoking
Supplier on
supplier, regardless of its input.
|
static <E> Function |
Functions.identity()
Returns the identity function.
|
static <T> Function |
Suppliers.supplierFunction()
Returns a function that accepts a supplier and returns the result of invoking
Supplier on that supplier.
|
static Function |
Functions.toStringFunction()
Returns a function that calls
toString() on its argument.
|
| Modifier and Type | Method and Description |
|---|---|
static <F |
Suppliers.compose(Function
Returns a new supplier which is the composition of the provided function and supplier.
|
static <A |
Functions.compose(Function
Returns the composition of two functions.
|
static <A |
Functions.compose(Function
Returns the composition of two functions.
|
static <A |
Predicates.compose(Predicate
Returns the composition of a function and a predicate.
|
static <A |
Converter.from(Function
Returns a converter based on
existing forward and backward functions.
|
static <A |
Converter.from(Function
Returns a converter based on
existing forward and backward functions.
|
<F> Equivalence |
Equivalence.onResultOf(Function
Returns a new equivalence relation for
F which evaluates equivalence by first applying
function to the argument, then evaluating using
this.
|
abstract <V> Optional |
Optional.transform(Function
If the instance is present, it is transformed with the given
Function; otherwise,
Optional is returned.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
LoadingCache<K
A semi-persistent mapping from keys to values.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractLoadingCache<K
This class provides a skeletal implementation of the
Cache interface to minimize the effort required to implement this interface.
|
class |
ForwardingLoadingCache<K
A cache which forwards all its method calls to another cache.
|
static class |
ForwardingLoadingCache
A simplified version of
ForwardingLoadingCache where subclasses can pass in an already constructed
LoadingCache as the delegete.
|
| Modifier and Type | Method and Description |
|---|---|
static <K |
CacheLoader.from(Function
Returns a cache loader based on an
existing function instance.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Function |
Interners.asFunction(Interner
Returns a function that delegates to the
Interner method of the given interner.
|
| Modifier and Type | Method and Description |
|---|---|
static <K |
Maps.asMap(NavigableSet
Returns a view of the navigable set as a map, mapping keys from the set according to the specified function.
|
static <K |
Maps.asMap(Set
Returns a live
Map view whose keys are the contents of
set and whose values are computed on demand using
function.
|
static <K |
Maps.asMap(SortedSet
Returns a view of the sorted set as a map, mapping keys from the set according to the specified function.
|
<K> ImmutableListMultimap |
FluentIterable.index(Function
Creates an index
ImmutableListMultimap that contains the results of applying a specified function to each item in this
FluentIterable of values.
|
static <K |
Multimaps.index(Iterable
Creates an index
ImmutableListMultimap that contains the results of applying a specified function to each item in an
Iterable of values.
|
static <K |
Multimaps.index(Iterator
Creates an index
ImmutableListMultimap that contains the results of applying a specified function to each item in an
Iterator of values.
|
<F> Ordering |
Ordering.onResultOf(Function
Returns a new ordering on
F which orders elements by first applying a function to them, then comparing those results using
this.
|
<V> ImmutableMap |
FluentIterable.toMap(Function
Returns an immutable map for which the elements of this
FluentIterable are the keys in the same order, mapped to values by the given function.
|
static <K |
Maps.toMap(Iterable
Returns an immutable map whose keys are the distinct elements of
keys and whose value for each key was computed by
valueFunction.
|
static <K |
Maps.toMap(Iterator
Returns an immutable map whose keys are the distinct elements of
keys and whose value for each key was computed by
valueFunction.
|
static <F |
Collections2.transform(Collection
Returns a collection that applies
function to each element of
fromCollection.
|
<T> FluentIterable |
FluentIterable.transform(Function
Returns a fluent iterable that applies
function to each element of this fluent iterable.
|
static <F |
Iterables.transform(Iterable
Returns an iterable that applies
function to each element of
fromIterable.
|
static <F |
Iterators.transform(Iterator
Returns an iterator that applies
function to each element of
fromIterator.
|
static <F |
Lists.transform(List
Returns a list that applies
function to each element of
fromList.
|
<T> FluentIterable |
FluentIterable.transformAndConcat(Function
Applies
function to each element of this fluent iterable and returns a fluent iterable with the concatenated combination of results.
|
static <K |
Multimaps.transformValues(ListMultimap
Returns a view of a
ListMultimap where each value is transformed by a function.
|
static <K |
Maps.transformValues(Map
Returns a view of a map where each value is transformed by a function.
|
static <K |
Multimaps.transformValues(Multimap
Returns a view of a multimap where each value is transformed by a function.
|
static <K |
Maps.transformValues(NavigableMap
Returns a view of a navigable map where each value is transformed by a function.
|
static <K |
Maps.transformValues(SortedMap
Returns a view of a sorted map where each value is transformed by a function.
|
static <R |
Tables.transformValues(Table
Returns a view of a table where each value is transformed by a function.
|
<K> ImmutableMap |
FluentIterable.uniqueIndex(Function
Returns an immutable map for which the
Map are the elements of this
FluentIterable in the given order, and each key is the product of invoking a supplied function on its corresponding value.
|
static <K |
Maps.uniqueIndex(Iterable
Returns an immutable map for which the
Map are the given elements in the given order, and each key is the product of invoking a supplied function on its corresponding value.
|
static <K |
Maps.uniqueIndex(Iterator
Returns an immutable map for which the
Map are the given elements in the given order, and each key is the product of invoking a supplied function on its corresponding value.
|
| Modifier and Type | Method and Description |
|---|---|
Function |
Escaper.asFunction()
Returns a
Function that invokes
Escaper on this escaper.
|
| Modifier and Type | Method and Description |
|---|---|
static <I |
Futures.lazyTransform(Future
Like
Futures except that the transformation
function is invoked on each call to
get() on the returned future.
|
static <V |
Futures.makeChecked(ListenableFuture
Creates a
CheckedFuture out of a normal
ListenableFuture and a
Function that maps from
Exception instances into the appropriate checked type.
|
static <I |
Futures.transform(ListenableFuture
Returns a new
ListenableFuture whose result is the product of applying the given
Function to the result of the given
Future.
|
static <I |
Futures.transform(ListenableFuture
Returns a new
ListenableFuture whose result is the product of applying the given
Function to the result of the given
Future.
|