@Component public class MapBasedAttachmentCache extends Object implements AttachmentCache
ConcurrentHashMap 实现的 AttachmentCache
Date: 19-1-23 下午12:04AttachmentCache| 构造器和说明 |
|---|
MapBasedAttachmentCache() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
attach(String key,
Object attachment)
key 附加一个对象 |
void |
attach(String mainKey,
String key,
Object attachment)
mainKey 附加 key 类型的对象 |
<T> T |
attachment(String key)
获取
key的附加对象 |
<T> T |
attachment(String mainKey,
String key)
获取
mainKey key类型的附加对象 |
boolean |
containsKey(String key)
key是否存在附加对象 |
boolean |
containsKey(String mainKey,
String key)
mainKey是否存在key类型的附加对象 |
void |
remove(String key)
移除
key的附加对象 |
void |
remove(String mainKey,
String key)
移除
mainKey key类型的附加对象 |
void |
removeAll(String mainKey)
移除
mainKey所有类型的附加对象 |
public void attach(String mainKey, String key, Object attachment)
AttachmentCachemainKey 附加 key 类型的对象attach 在接口中 AttachmentCachemainKey - mainKeykey - keyattachment - attachmentpublic void attach(String key, Object attachment)
AttachmentCachekey 附加一个对象attach 在接口中 AttachmentCachekey - keyattachment - attachmentpublic <T> T attachment(String mainKey, String key)
AttachmentCachemainKey key类型的附加对象attachment 在接口中 AttachmentCacheT - typemainKey - mainKeykey - keypublic <T> T attachment(String key)
AttachmentCachekey的附加对象attachment 在接口中 AttachmentCacheT - typekey - keypublic void remove(String mainKey, String key)
AttachmentCachemainKey key类型的附加对象remove 在接口中 AttachmentCachemainKey - mainKeykey - keypublic void removeAll(String mainKey)
AttachmentCachemainKey所有类型的附加对象removeAll 在接口中 AttachmentCachemainKey - mainKeypublic boolean containsKey(String mainKey, String key)
AttachmentCachemainKey是否存在key类型的附加对象containsKey 在接口中 AttachmentCachemainKey - mainKeykey - keypublic boolean containsKey(String key)
AttachmentCachekey是否存在附加对象containsKey 在接口中 AttachmentCachekey - keypublic void remove(String key)
AttachmentCachekey的附加对象remove 在接口中 AttachmentCachekey - keyCopyright © 2019. All rights reserved.