public class CacheOptions<K,V> extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CacheOptions.WriteMode
缓存的四种模式:stand by,read through,write through,write behind。
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
CacheOptions() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <K,V> CacheOptions<K,V> |
defaults() |
boolean |
equals(Object o) |
CacheLoader<K,V> |
getLoader() |
String |
getName() |
int |
getWriteBehindThreads() |
CacheOptions.WriteMode |
getWriteMode() |
CacheWriter<K,V> |
getWriter() |
int |
hashCode() |
CacheOptions<K,V> |
loader(CacheLoader<K,V> loader)
Sets
CacheLoader object. |
CacheOptions<K,V> |
name(String name)
Sets cache
name. |
CacheOptions<K,V> |
writeBehindThreads(int writeBehindThreads)
Sets threads amount used in write behind mode.
|
CacheOptions<K,V> |
writeMode(CacheOptions.WriteMode writeMode)
Sets write mode.
|
CacheOptions<K,V> |
writer(CacheWriter<K,V> writer)
Sets
CacheWriter object. |
public static <K,V> CacheOptions<K,V> defaults()
public CacheOptions<K,V> name(String name)
name.name - cache namepublic String getName()
public CacheOptions<K,V> writer(CacheWriter<K,V> writer)
CacheWriter object.writer - objectpublic CacheWriter<K,V> getWriter()
public CacheOptions<K,V> writeBehindThreads(int writeBehindThreads)
Default is 1
writeBehindThreads - - threads amountpublic int getWriteBehindThreads()
public CacheOptions<K,V> writeMode(CacheOptions.WriteMode writeMode)
Default is CacheOptions.WriteMode.WRITE_THROUGH
writeMode - - write modepublic CacheOptions.WriteMode getWriteMode()
public CacheOptions<K,V> loader(CacheLoader<K,V> loader)
CacheLoader object.loader - objectpublic CacheLoader<K,V> getLoader()
Copyright © 2021. All rights reserved.