| Enum Constant and Description |
|---|
DEFAULT
默认(按照 Http 协议来缓存)
|
NO_CACHE
不使用缓存(禁用 Http 协议缓存)
|
USE_CACHE_AFTER_FAILURE
只在网络请求失败才去读缓存
|
USE_CACHE_FIRST
优先使用缓存
有缓存的情况下:先读缓存 —> 回调成功 —> 请求网络 —> 刷新缓存
无缓存的情况下:请求网络 -> 写入缓存 -> 回调成功
|
USE_CACHE_ONLY
只使用缓存
有缓存的情况下:读取缓存 -> 回调成功
无缓存的情况下:请求网络 -> 写入缓存 -> 回调成功
|
| Modifier and Type | Method and Description |
|---|---|
static CacheMode |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CacheMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CacheMode DEFAULT
public static final CacheMode NO_CACHE
public static final CacheMode USE_CACHE_ONLY
public static final CacheMode USE_CACHE_FIRST
public static final CacheMode USE_CACHE_AFTER_FAILURE
public static CacheMode[] values()
for (CacheMode c : CacheMode.values()) System.out.println(c);
public static CacheMode valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is null