Enum Class NetworkOptions.CacheStrategy

java.lang.Object
java.lang.Enum<NetworkOptions.CacheStrategy>
es.situm.sdk.configuration.network.NetworkOptions.CacheStrategy
All Implemented Interfaces:
Serializable, Comparable<NetworkOptions.CacheStrategy>, Constable
Enclosing interface:
NetworkOptions

public static enum NetworkOptions.CacheStrategy extends Enum<NetworkOptions.CacheStrategy>
Supported SDK Cache Strategies.
  • Enum Constant Details

    • TIMED_CACHE

      public static final NetworkOptions.CacheStrategy TIMED_CACHE
      Always return cached data immediately. If the cache has expired, a network request is triggered to refresh the data. 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 Details

    • values

      public static NetworkOptions.CacheStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NetworkOptions.CacheStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null