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.
| Modifier and Type | Interface and Description |
|---|---|
| public interface | Cache<
the type of the cache's keys, which are not permitted to be null K, the type of the cache's values, which are not permitted to be null V>A semi-persistent mapping from keys to values. |
| public interface | LoadingCache<
the type of the cache's keys, which are not permitted to be null K, the type of the cache's values, which are not permitted to be null V>A semi-persistent mapping from keys to values. |
| pack-priv interface | LongAddable
Abstract interface for objects that can concurrently add longs. |
| pack-priv interface | |
| public interface | RemovalListener<
the most general type of keys this listener can listen for; for example K, Object
if any key is acceptablethe most general type of values this listener can listen for; for example V>Object if any key is acceptableAn object that can receive a notification when an entry is removed from a cache. |
| public interface |
| Modifier and Type | Annotation and Description |
|---|---|
| pack-priv @interface | ElementTypesAreNonnullByDefault
Marks all "top-level" types as non-null in a way that is recognized by Kotlin. |
| pack-priv @interface | ParametricNullness
Annotates a "top-level" type-variable usage that takes its nullness from the type argument supplied by the user of the class. |
| Modifier and Type | Class and Description |
|---|---|
| public abstract class | AbstractCache<K, V>
This class provides a skeletal implementation of the |
| public abstract class | AbstractLoadingCache<K, V>
This class provides a skeletal implementation of the |
| public class | CacheBuilder<
the most general key type this builder will be able to create caches for. This is
normally K, Object unless it is constrained by using a method like #removalListener. Cache keys may not be null.the most general value type this builder will be able to create caches for. This is
normally V>Object unless it is constrained by using a method like #removalListener. Cache values may not be null.A builder of |
| public class | CacheBuilderSpec
A specification of a |
| public abstract class | CacheLoader<K, V>
Computes or retrieves values, based on a key, for use in populating a |
| public class | CacheStats
Statistics about the performance of a |
| public abstract class | |
| public abstract class | |
| pack-priv class | |
| pack-priv class | LongAddables
Source of |
| pack-priv class | LongAdder
One or more variables that together maintain an initially zero |
| public class | RemovalListeners
A collection of common removal listeners. |
| public class | |
| pack-priv abstract class | Striped64
A package-local class holding common representation and mechanics for classes supporting dynamic striping on 64bit values. |
| Modifier and Type | Enum and Description |
|---|---|
| public enum | RemovalCause
The reason why a cached entry was removed. |