Interface Cache<K,V>
- Type Parameters:
K- 鍵的型別V- 值的型別
- All Known Implementing Classes:
DualLayerCache, EhcacheCacheAdapter, ManagedCache
public interface Cache<K,V>
快取介面
定義快取的核心操作,包含基本的讀寫、管理功能與狀態查詢。
- Since:
- 1.0
-
Method Details
-
get
-
put
-
remove
-
clear
void clear()清空所有快取項目 -
containsKey
-
disable
void disable()停用快取
停用後:
- get() 操作返回 null
- put() 操作被忽略
- 已存在的資料保留
- 可透過 enable() 重新啟用
-
enable
void enable()啟用快取 -
isEnabled
boolean isEnabled()檢查快取是否已啟用- Returns:
- true 若快取已啟用
-
getStatistics
-
getStatus
-
getName
-
getConfiguration
-