Enum ResponseSource

java.lang.Object
java.lang.Enum<ResponseSource>
com.squareup.okhttp.ResponseSource
All Implemented Interfaces:
Serializable, Comparable<ResponseSource>

public enum ResponseSource
extends Enum<ResponseSource>
The source of an HTTP response.
  • Enum Constant Details

    • CACHE

      public static final ResponseSource CACHE
      The response was returned from the local cache.
    • CONDITIONAL_CACHE

      public static final ResponseSource CONDITIONAL_CACHE
      The response is available in the cache but must be validated with the network. The cache result will be used if it is still valid; otherwise the network's response will be used.
    • NETWORK

      public static final ResponseSource NETWORK
      The response was returned from the network.
  • Method Details

    • values

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

      public static ResponseSource valueOf​(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • requiresConnection

      public boolean requiresConnection()