public class MiniProgramDataStorage extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CACHE_CREATE_FAILED |
static int |
CACHE_EXPIRED |
static int |
CACHE_OUT_OF_MEMORY |
static int |
INVALID_VALUE |
static int |
KEY_EXPIRED |
static int |
KEY_NOT_FOUND |
| Constructor and Description |
|---|
MiniProgramDataStorage(String diskStorageDirectory,
String appId,
int diskStorageSize,
int storageExpireTimeSeconds) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
String |
get(String key) |
String |
getAll() |
int |
getSize() |
boolean |
put(String key,
String value) |
protected boolean |
put(String key,
String value,
boolean isPutToDisk) |
boolean |
put(String key,
String value,
long expTime) |
protected boolean |
put(String key,
String value,
long itemExpireTimeSeconds,
boolean isPutToDisk) |
protected boolean |
putDataToDiskCache() |
boolean |
remove(String key) |
protected boolean |
remove(String key,
boolean isPutToDiskCache) |
void |
removeErrorListener(com.zing.zalo.zbrowser.cache.MiniProgramDataStorage.ErrorListener errorListener) |
void |
setOnErrorListener(com.zing.zalo.zbrowser.cache.MiniProgramDataStorage.ErrorListener errorListener) |
public static final int CACHE_OUT_OF_MEMORY
public static final int CACHE_EXPIRED
public static final int CACHE_CREATE_FAILED
public static final int KEY_NOT_FOUND
public static final int KEY_EXPIRED
public static final int INVALID_VALUE
protected boolean put(String key, String value, long itemExpireTimeSeconds, boolean isPutToDisk)
protected boolean putDataToDiskCache()
public boolean remove(String key)
protected boolean remove(String key, boolean isPutToDiskCache)
public void clear()
public String getAll()
public int getSize()
public void setOnErrorListener(com.zing.zalo.zbrowser.cache.MiniProgramDataStorage.ErrorListener errorListener)
public void removeErrorListener(com.zing.zalo.zbrowser.cache.MiniProgramDataStorage.ErrorListener errorListener)