Key - 缓存 key 类型Value - 缓存 value 类型public class CacheObj<Key extends Serializable,Value extends Serializable> extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
private <T> T |
cast(Object obj) |
net.sf.ehcache.search.Query |
createQuery() |
void |
dispose() |
void |
evictExpiredElements() |
void |
flush() |
Value |
get(Key key) |
net.sf.ehcache.Cache |
getCache() |
String |
getName() |
int |
getSize() |
boolean |
isKeyInCache(Key key) |
boolean |
isValueInCache(Key key) |
void |
put(Key key,
Value value) |
net.sf.ehcache.Element |
putIfAbsent(Key key,
Value value) |
boolean |
remove(Key key) |
void |
remove(Set<Key> set) |
net.sf.ehcache.Element |
replace(Key key,
Value value) |
boolean |
replace(Key key,
Value valueOld,
Value valueNew) |
private String cacheName
private net.sf.ehcache.Cache cache
public CacheObj(String cacheName)
public net.sf.ehcache.Cache getCache()
public int getSize()
public net.sf.ehcache.search.Query createQuery()
public void evictExpiredElements()
public boolean remove(Key key)
public boolean isKeyInCache(Key key)
public boolean isValueInCache(Key key)
public String getName()
public void flush()
public void dispose()
private <T> T cast(Object obj)
Copyright © 2023. All rights reserved.