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:
com.github.javaparser.resolution.cache.Cache<K,V>
public class GuavaCache<K,V> extends Object implements com.github.javaparser.resolution.cache.Cache<K,V>
This class is used to wrap a GuavaCache.
-
-
Constructor Summary
Constructors Constructor Description GuavaCache(com.google.common.cache.Cache<K,V> guavaCache)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(K key)static <expectedK,expectedV>
GuavaCache<expectedK,expectedV>create(com.google.common.cache.Cache<expectedK,expectedV> guavaCache)Wrap a Guava cache with a custom cache.Optional<V>get(K key)booleanisEmpty()voidput(K key, V value)voidremove(K key)voidremoveAll()longsize()com.github.javaparser.resolution.cache.CacheStatsstats()
-
-
-
Method Detail
-
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.
-
remove
public void remove(K key)
-
removeAll
public void removeAll()
-
contains
public boolean contains(K key)
-
size
public long size()
-
isEmpty
public boolean isEmpty()
-
-