Package com.squareup.okhttp
Enum ResponseSource
- All Implemented Interfaces:
Serializable,Comparable<ResponseSource>
public enum ResponseSource extends Enum<ResponseSource>
The source of an HTTP response.
-
Enum Constant Summary
Enum Constants Enum Constant Description CACHEThe response was returned from the local cache.CONDITIONAL_CACHEThe response is available in the cache but must be validated with the network.NETWORKThe response was returned from the network. -
Method Summary
Modifier and Type Method Description booleanrequiresConnection()static ResponseSourcevalueOf(String name)Returns the enum constant of this type with the specified name.static ResponseSource[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CACHE
The response was returned from the local cache. -
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
The response was returned from the network.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
requiresConnection
public boolean requiresConnection()
-