Class GuavaCache<K,V>
java.lang.Object
com.github.javaparser.symbolsolver.cache.GuavaCache<K,V>
- Type Parameters:
K- The type of the key.V- The type of the value.
- All Implemented Interfaces:
Cache<K,V>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnsTrueif the cache contains a entry with the key, orFalseif there is none.static <expectedK, expectedV>
GuavaCache<expectedK, expectedV> create(com.google.common.cache.Cache<expectedK, expectedV> guavaCache) Wrap a Guava cache with a custom cache.Returns the value associated withkeyin this cache, or empty if there is no cached value forkey.booleanisEmpty()ReturnsTrueif the cache is empty, orFalseif there's at least a entry stored in cache.voidAssociates value with key in this cache.voidDiscards any cached value for this key.voidDiscards all entries in the cache.longsize()Returns the number of entries in this cache.stats()Returns a current snapshot of this cache's cumulative statistics, or a set of default values if the cache is not recording statistics.
-
Field Details
-
guavaCache
-
-
Constructor Details
-
GuavaCache
-
-
Method Details
-
create
public static <expectedK, expectedV> GuavaCache<expectedK, expectedV> create(com.google.common.cache.Cache<expectedK, expectedV> guavaCache) Wrap a Guava cache with a custom cache.- Type Parameters:
expectedK- The expected type for the key.expectedV- The expected type for the value.- Parameters:
guavaCache- The guava cache to be wrapped-- Returns:
- A newly created instance of
NoCache.
-
put
Description copied from interface:CacheAssociates value with key in this cache.
If the cache previously contained a value associated with key, the old value is replaced by value. -
get
-
remove
-
removeAll
-
contains
-
size
-
isEmpty
-
stats
Description copied from interface:CacheReturns a current snapshot of this cache's cumulative statistics, or a set of default values if the cache is not recording statistics. All statistics begin at zero and never decrease over the lifetime of the cache.
-