public class CacheConfig
extends java.lang.Object
| 构造器和说明 |
|---|
CacheConfig()
Creates config object with
ttl = 0 and
maxIdleTime = 0. |
CacheConfig(long maxIdleTime)
Creates config object.
|
CacheConfig(long ttl,
long maxIdleTime,
int maxSize)
Creates config object.
|
CacheConfig(long ttl,
long maxIdleTime,
java.util.concurrent.TimeUnit timeUnit,
int maxSize)
Creates config object.
|
CacheConfig(long maxIdleTime,
java.util.concurrent.TimeUnit timeUnit)
Creates config object.
|
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getMaxIdleTime()
Gets the max idle time.
|
int |
getMaxSize()
Gets the max size.
|
java.util.concurrent.TimeUnit |
getTimeUnit()
Gets the time unit.
|
long |
getTTL()
Gets the ttl.
|
void |
setMaxIdleTime(long maxIdleTime)
Set max idle time for key\value entry in milliseconds.
|
void |
setMaxSize(int maxSize)
Set max size of map.
|
void |
setTimeUnit(java.util.concurrent.TimeUnit timeUnit)
Sets the time unit.
|
void |
setTTL(long ttl)
Set time to live for key\value entry in milliseconds.
|
public CacheConfig()
ttl = 0 and
maxIdleTime = 0.public CacheConfig(long maxIdleTime)
maxIdleTime - - max idle time for key\value entry in milliseconds.
if maxIdleTime and ttl
params are equal to 0 then entry stores
infinitely.
public CacheConfig(long maxIdleTime,
java.util.concurrent.TimeUnit timeUnit)
maxIdleTime - - max idle time for key\value entry in milliseconds.
if maxIdleTime and ttl
params are equal to 0 then entry stores
infinitely.
timeUnit - the time unitpublic CacheConfig(long ttl,
long maxIdleTime,
int maxSize)
ttl - - time to live for key\value entry in milliseconds. If
0 then time to live doesn't affect entry
expiration.maxIdleTime - - max idle time for key\value entry in milliseconds.
if maxIdleTime and ttl
params are equal to 0 then entry stores
infinitely.
maxSize - the max sizepublic CacheConfig(long ttl,
long maxIdleTime,
java.util.concurrent.TimeUnit timeUnit,
int maxSize)
ttl - - time to live for key\value entry in milliseconds. If
0 then time to live doesn't affect entry
expiration.maxIdleTime - - max idle time for key\value entry in milliseconds.
if maxIdleTime and ttl
params are equal to 0 then entry stores
infinitely.
timeUnit - the time unitmaxSize - the max sizepublic long getTTL()
public void setTTL(long ttl)
ttl - - time to live for key\value entry in milliseconds. If
0 then time to live doesn't affect entry
expiration.public int getMaxSize()
public void setMaxSize(int maxSize)
maxSize - - max size If 0 the cache is unbounded
(default).public long getMaxIdleTime()
public void setMaxIdleTime(long maxIdleTime)
maxIdleTime - - max idle time for key\value entry in milliseconds.
If 0 then max idle time doesn't affect
entry expiration.public java.util.concurrent.TimeUnit getTimeUnit()
public void setTimeUnit(java.util.concurrent.TimeUnit timeUnit)
timeUnit - timeUnit