/** * Creates a Level 1 cache that internally maintains a separate satellite cache * for each thread that accesses it. Keys are compared by reference identity. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalIdentityCache() { return new ThreadLocalCache<>(); }
/** * Creates a Level 1 cache that internally maintains a separate satellite cache * for each thread that accesses it. Keys are compared by reference identity. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalIdentityCache() { return new ThreadLocalCache<>(); }
/** * Creates a Level 1 cache that internally maintains a separate satellite cache * for each thread that accesses it. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalCache() { return new ThreadLocalCache<>(); }
/** * Creates a Level 1 cache that internally maintains a separate satellite cache * for each thread that accesses it. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalCache() { return new ThreadLocalCache<>(); }
/** * Creates a Level 1 cache that internally maintains a separate satellite cache * for each thread that accesses it. Keys are compared by reference identity. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalIdentityCache() { return new ThreadLocalCache<>(); }
/** * Creates a Level 1 cache that internally maintains a separate satellite cache * for each thread that accesses it. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalCache() { return new ThreadLocalCache<>(); }
/** * Creates a Level 2 cache that internally maintains a separate satellite cache * for each thread that accesses it. On a cache miss, the parent cache will be * checked. On an insert, the value will propagate up to the parent cache. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalCache(final Cache<K, V> parent) { return new ThreadLocalCache<>(VerifyArgument.notNull(parent, "parent")); }
/** * Creates a Level 2 cache that internally maintains a separate satellite cache * for each thread that accesses it. On a cache miss, the parent cache will be * checked. On an insert, the value will propagate up to the parent cache. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalCache(final Cache<K, V> parent) { return new ThreadLocalCache<>(VerifyArgument.notNull(parent, "parent")); }
/** * Creates a Level 2 cache that internally maintains a separate satellite cache * for each thread that accesses it. On a cache miss, the parent cache will be * checked. On an insert, the value will propagate up to the parent cache. * * @param <K> * The type of keys used to identify values in the cache. * @param <V> * The type of values stored in the cache. * * @return The newly created cache. */ public static <K, V> Cache<K, V> createThreadLocalCache(final Cache<K, V> parent) { return new ThreadLocalCache<>(VerifyArgument.notNull(parent, "parent")); }