| 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.
|
| 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 <T> Supplier |
Suppliers.memoize(Supplier
Returns a supplier which caches the instance retrieved during the first call to
get() and returns that value on subsequent calls to
get().
|
static <T> Supplier |
Suppliers.memoizeWithExpiration(Supplier
Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed.
|
static <T> Supplier |
Suppliers.ofInstance(T instance)
Returns a supplier that always supplies
instance.
|
static <T> Supplier |
Suppliers.synchronizedSupplier(Supplier
Returns a supplier whose
get() method synchronizes on
delegate before calling it, making it thread-safe.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Function |
Suppliers.supplierFunction()
Returns a function that accepts a supplier and returns the result of invoking
get() on that supplier.
|
| 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 <T> Function |
Functions.forSupplier(Supplier
Returns a function that always returns the result of invoking
get() on
supplier, regardless of its input.
|
static <T> Supplier |
Suppliers.memoize(Supplier
Returns a supplier which caches the instance retrieved during the first call to
get() and returns that value on subsequent calls to
get().
|
static <T> Supplier |
Suppliers.memoizeWithExpiration(Supplier
Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed.
|
abstract T |
Optional.or(Supplier
Returns the contained instance if it is present;
supplier.get() otherwise.
|
static <T> Supplier |
Suppliers.synchronizedSupplier(Supplier
Returns a supplier whose
get() method synchronizes on
delegate before calling it, making it thread-safe.
|
| Modifier and Type | Method and Description |
|---|---|
static <V> CacheLoader |
CacheLoader.from(Supplier
Returns a cache loader based on an
existing supplier instance.
|
| Modifier and Type | Method and Description |
|---|---|
static <R |
Tables.newCustomTable(Map
Creates a table that uses the specified backing map and factory.
|
static <K |
Multimaps.newListMultimap(Map
Creates a new
ListMultimap that uses the provided map and factory.
|
static <K |
Multimaps.newMultimap(Map
Creates a new
Multimap backed by
map, whose internal value collections are generated by
factory.
|
static <K |
Multimaps.newSetMultimap(Map
Creates a new
SetMultimap that uses the provided map and factory.
|
static <K |
Multimaps.newSortedSetMultimap(Map
Creates a new
SortedSetMultimap that uses the provided map and factory.
|