Enum NetworkOptions.CacheStrategy
- java.lang.Object
-
- java.lang.Enum<NetworkOptions.CacheStrategy>
-
- es.situm.sdk.configuration.network.NetworkOptions.CacheStrategy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<NetworkOptions.CacheStrategy>
- Enclosing interface:
- NetworkOptions
public static enum NetworkOptions.CacheStrategy extends java.lang.Enum<NetworkOptions.CacheStrategy>
Supported SDK Cache Strategies.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CACHE_FIRST
Force to use cache even if it's too old.IGNORE_CACHE
Force download from server, the cache won't be used.SERVER_FIRST
Force download from server.TIMED_CACHE
If there is no cache or if the cache is too old it will download from server.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NetworkOptions.CacheStrategy
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static NetworkOptions.CacheStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TIMED_CACHE
public static final NetworkOptions.CacheStrategy TIMED_CACHE
If there is no cache or if the cache is too old it will download from server. This is the default option.
-
CACHE_FIRST
public static final NetworkOptions.CacheStrategy CACHE_FIRST
Force to use cache even if it's too old. If there is not cache available it will try to download from server.
-
IGNORE_CACHE
public static final NetworkOptions.CacheStrategy IGNORE_CACHE
Force download from server, the cache won't be used. Recommended only for development.
-
SERVER_FIRST
public static final NetworkOptions.CacheStrategy SERVER_FIRST
Force download from server. If the server is not responding or there is no internet connection it will use the cache. Recommended only for development.
-
-
Method Detail
-
values
public static NetworkOptions.CacheStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NetworkOptions.CacheStrategy c : NetworkOptions.CacheStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NetworkOptions.CacheStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-