Package com.google.common.cache
@ParametersAreNonnullByDefault
package com.google.common.cache
Discouraged (in favor of Caffeine) caching utilities.
The core interface used to represent caches is Cache
. In-memory caches can be
configured and created using CacheBuilder
, with cache entries being loaded by CacheLoader
. Statistics about cache performance are exposed using CacheStats
.
See the Guava User Guide article on caches.
This package is a part of the open-source Guava library.
-
ClassDescriptionAbstractCache<K,
V> This class provides a skeletal implementation of theCache
interface to minimize the effort required to implement this interface.A thread-safeAbstractCache.StatsCounter
implementation for use byCache
implementors.Accumulates statistics during the operation of aCache
for presentation byCache.stats()
.AbstractLoadingCache<K,V> This class provides a skeletal implementation of theCache
interface to minimize the effort required to implement this interface.Cache<K,V> A semi-persistent mapping from keys to values.CacheBuilder<K,V> A builder ofLoadingCache
andCache
instances.A specification of aCacheBuilder
configuration.Parse expireAfterAccessParse concurrencyLevelBase class for parsing times with durationsParse initialCapacityBase class for parsing integers.Parse weakKeysBase class for parsing integers.Parse maximumSizeParse maximumWeightParse recordStatsParse refreshAfterWriteParses a single value.Parse weakValues and softValuesParse expireAfterWriteCacheLoader<K,V> Computes or retrieves values, based on a key, for use in populating aLoadingCache
.Thrown to indicate that an invalid response was returned from a call toCacheLoader
.Exception thrown byloadAll()
to indicate that it is not supported.Statistics about the performance of aCache
.Marks all "top-level" types as non-null in a way that is recognized by Kotlin.ForwardingCache<K,V> A cache which forwards all its method calls to another cache.A simplified version ofForwardingCache
where subclasses can pass in an already constructedCache
as the delegate.A cache which forwards all its method calls to another cache.A simplified version ofForwardingLoadingCache
where subclasses can pass in an already constructedLoadingCache
as the delegate.Disables Animal Sniffer's checking of compatibility with older versions of Java/Android.LoadingCache<K,V> A semi-persistent mapping from keys to values.LocalCache<K,V> The concurrent hash map implementation built byCacheBuilder
.A custom queue for managing access order.Creates new entries.Serializes the configuration of a LocalCache, reconstituting it as an LoadingCache using CacheBuilder upon deserialization.Serializes the configuration of a LocalCache, reconstituting it as a Cache using CacheBuilder upon deserialization.LocalCache.Segment<K,V> Segments are specialized versions of hash tables.References a soft value.Used for strongly-referenced keys.References a strong value.A reference to a value.LocalCache.WeakEntry<K,V> Used for weakly-referenced keys.References a weak value.References a soft value.References a strong value.References a weak value.A custom queue for managing eviction order.Abstract interface for objects that can concurrently add longs.Source ofLongAddable
objects that deals with GWT, Unsafe, and all that.One or more variables that together maintain an initially zerolong
sum.Annotates a "top-level" type-variable usage that takes its nullness from the type argument supplied by the user of the class.ReferenceEntry<K,V> An entry in a reference map.The reason why a cached entry was removed.RemovalListener<K,V> An object that can receive a notification when an entry is removed from a cache.A collection of common removal listeners.RemovalNotification<K,V> A notification of the removal of a single entry.A package-local class holding common representation and mechanics for classes supporting dynamic striping on 64bit values.Padded variant of AtomicLong supporting only raw accesses plus CAS.Weigher<K,V> Calculates the weights of cache entries.