Uses of Interface
com.google.common.base.Supplier
-
Packages that use Supplier Package Description com.google.common.base Basic utility libraries and interfaces.com.google.common.cache Discouraged (in favor of Caffeine) caching utilities.com.google.common.collect 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 Supplier Modifier and Type Method Description static <F extends @Nullable java.lang.Object,T extends @Nullable java.lang.Object>
Supplier<T>Suppliers. compose(Function<? super F,T> function, Supplier<F> supplier)
Returns a new supplier which is the composition of the provided function and supplier.static <T extends @Nullable java.lang.Object>
Supplier<T>Suppliers. memoize(Supplier<T> delegate)
Returns a supplier which caches the instance retrieved during the first call toget()
and returns that value on subsequent calls toget()
.static <T extends @Nullable java.lang.Object>
Supplier<T>Suppliers. memoizeWithExpiration(Supplier<T> delegate, long duration, java.util.concurrent.TimeUnit unit)
Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed.static <T extends @Nullable java.lang.Object>
Supplier<T>Suppliers. memoizeWithExpiration(Supplier<T> delegate, java.time.Duration duration)
Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed.static <T extends @Nullable java.lang.Object>
Supplier<T>Suppliers. ofInstance(T instance)
Returns a supplier that always suppliesinstance
.static <T extends @Nullable java.lang.Object>
Supplier<T>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 Supplier Modifier and Type Method Description static <T extends @Nullable java.lang.Object>
Function<Supplier<T>,T>Suppliers. 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 Supplier Modifier and Type Method Description static <F extends @Nullable java.lang.Object,T extends @Nullable java.lang.Object>
Supplier<T>Suppliers. compose(Function<? super F,T> function, Supplier<F> supplier)
Returns a new supplier which is the composition of the provided function and supplier.static <F extends @Nullable java.lang.Object,T extends @Nullable java.lang.Object>
Function<F,T>Functions. forSupplier(Supplier<T> supplier)
Returns a function that ignores its input and returns the result ofsupplier.get()
.static <T extends @Nullable java.lang.Object>
Supplier<T>Suppliers. memoize(Supplier<T> delegate)
Returns a supplier which caches the instance retrieved during the first call toget()
and returns that value on subsequent calls toget()
.static <T extends @Nullable java.lang.Object>
Supplier<T>Suppliers. memoizeWithExpiration(Supplier<T> delegate, long duration, java.util.concurrent.TimeUnit unit)
Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed.static <T extends @Nullable java.lang.Object>
Supplier<T>Suppliers. memoizeWithExpiration(Supplier<T> delegate, java.time.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
Optional. or(Supplier<? extends T> supplier)
Returns the contained instance if it is present;supplier.get()
otherwise.static <T extends @Nullable java.lang.Object>
Supplier<T>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 Supplier Modifier and Type Method Description static <V> CacheLoader<java.lang.Object,V>
CacheLoader. from(Supplier<V> supplier)
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 Supplier Modifier and Type Method Description static <R,C,V>
Table<R,C,V>Tables. newCustomTable(java.util.Map<R,java.util.Map<C,V>> backingMap, Supplier<? extends java.util.Map<C,V>> factory)
Creates a table that uses the specified backing map and factory.static <K extends @Nullable java.lang.Object,V extends @Nullable java.lang.Object>
ListMultimap<K,V>Multimaps. newListMultimap(java.util.Map<K,java.util.Collection<V>> map, Supplier<? extends java.util.List<V>> factory)
Creates a newListMultimap
that uses the provided map and factory.static <K extends @Nullable java.lang.Object,V extends @Nullable java.lang.Object>
Multimap<K,V>Multimaps. newMultimap(java.util.Map<K,java.util.Collection<V>> map, Supplier<? extends java.util.Collection<V>> factory)
Creates a newMultimap
backed bymap
, whose internal value collections are generated byfactory
.static <K extends @Nullable java.lang.Object,V extends @Nullable java.lang.Object>
SetMultimap<K,V>Multimaps. newSetMultimap(java.util.Map<K,java.util.Collection<V>> map, Supplier<? extends java.util.Set<V>> factory)
Creates a newSetMultimap
that uses the provided map and factory.static <K extends @Nullable java.lang.Object,V extends @Nullable java.lang.Object>
SortedSetMultimap<K,V>Multimaps. newSortedSetMultimap(java.util.Map<K,java.util.Collection<V>> map, Supplier<? extends java.util.SortedSet<V>> factory)
Creates a newSortedSetMultimap
that uses the provided map and factory.
-