Uses of Interface
com.google.common.base.Supplier
Packages that use Supplier
Package
Description
Basic utility libraries and interfaces.
Discouraged (in favor of Caffeine) caching utilities.
Collection interfaces and implementations, and other utilities for collections.
-
Uses of Supplier in com.google.common.base
Methods in com.google.common.base that return SupplierModifier and TypeMethodDescriptionReturns a new supplier which is the composition of the provided function and supplier.Returns a supplier which caches the instance retrieved during the first call toget()
and returns that value on subsequent calls toget()
.Suppliers.memoizeWithExpiration
(Supplier<T> delegate, long duration, TimeUnit unit) Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed.Suppliers.memoizeWithExpiration
(Supplier<T> delegate, Duration duration) Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed.Suppliers.ofInstance
(T instance) Returns a supplier that always suppliesinstance
.Suppliers.synchronizedSupplier
(Supplier<T> delegate) Returns a supplier whoseget()
method synchronizes ondelegate
before calling it, making it thread-safe.Methods in com.google.common.base that return types with arguments of type SupplierModifier and TypeMethodDescriptionSuppliers.supplierFunction()
Returns a function that accepts a supplier and returns the result of invokingget()
on that supplier.Methods in com.google.common.base with parameters of type SupplierModifier and TypeMethodDescriptionReturns a new supplier which is the composition of the provided function and supplier.Functions.forSupplier
(Supplier<T> supplier) Returns a function that ignores its input and returns the result ofsupplier.get()
.Returns a supplier which caches the instance retrieved during the first call toget()
and returns that value on subsequent calls toget()
.Suppliers.memoizeWithExpiration
(Supplier<T> delegate, long duration, TimeUnit unit) Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed.Suppliers.memoizeWithExpiration
(Supplier<T> delegate, Duration duration) Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed.abstract T
Returns the contained instance if it is present;supplier.get()
otherwise.Suppliers.synchronizedSupplier
(Supplier<T> delegate) Returns a supplier whoseget()
method synchronizes ondelegate
before calling it, making it thread-safe. -
Uses of Supplier in com.google.common.cache
Methods in com.google.common.cache with parameters of type SupplierModifier and TypeMethodDescriptionstatic <V> CacheLoader
<Object, V> Returns a cache loader based on an existing supplier instance. -
Uses of Supplier in com.google.common.collect
Methods in com.google.common.collect with parameters of type SupplierModifier and TypeMethodDescriptionstatic <R,
C, V> Table <R, C, V> Tables.newCustomTable
(Map<R, Map<C, V>> backingMap, Supplier<? extends Map<C, V>> factory) Creates a table that uses the specified backing map and factory.static <K extends @Nullable Object,
V extends @Nullable Object>
ListMultimap<K, V> Multimaps.newListMultimap
(Map<K, Collection<V>> map, Supplier<? extends List<V>> factory) Creates a newListMultimap
that uses the provided map and factory.Multimaps.newMultimap
(Map<K, Collection<V>> map, Supplier<? extends Collection<V>> factory) Creates a newMultimap
backed bymap
, whose internal value collections are generated byfactory
.static <K extends @Nullable Object,
V extends @Nullable Object>
SetMultimap<K, V> Multimaps.newSetMultimap
(Map<K, Collection<V>> map, Supplier<? extends Set<V>> factory) Creates a newSetMultimap
that uses the provided map and factory.static <K extends @Nullable Object,
V extends @Nullable Object>
SortedSetMultimap<K, V> Multimaps.newSortedSetMultimap
(Map<K, Collection<V>> map, Supplier<? extends SortedSet<V>> factory) Creates a newSortedSetMultimap
that uses the provided map and factory.