public enum DefaultStateCache extends Enum<DefaultStateCache> implements StateCache
| Enum Constant and Description |
|---|
INSTANCE
当前实例
|
| Modifier and Type | Method and Description |
|---|---|
void |
cache(String key,
String value)
存入缓存
|
void |
cache(String key,
String value,
long timeout)
存入缓存
|
boolean |
containsKey(String key)
是否存在key,如果对应key的value值已过期,也返回false
|
String |
get(String key)
获取缓存内容
|
static DefaultStateCache |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DefaultStateCache[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DefaultStateCache INSTANCE
public static DefaultStateCache[] values()
for (DefaultStateCache c : DefaultStateCache.values()) System.out.println(c);
public static DefaultStateCache valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic void cache(String key, String value)
cache in interface StateCachekey - 缓存keyvalue - 缓存内容public void cache(String key, String value, long timeout)
cache in interface StateCachekey - 缓存keyvalue - 缓存内容timeout - 指定缓存过期时间(毫秒)public String get(String key)
get in interface StateCachekey - 缓存keypublic boolean containsKey(String key)
containsKey in interface StateCachekey - 缓存keyCopyright © 2020. All rights reserved.