public enum NetworkPolicy extends Enum<NetworkPolicy>
| Enum Constant and Description |
|---|
NO_CACHE
Skips checking the disk cache and forces loading through the network.
|
NO_STORE
Skips storing the result into the disk cache.
|
OFFLINE
Forces the request through the disk cache only, skipping network.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isOfflineOnly(int networkPolicy) |
static boolean |
shouldReadFromDiskCache(int networkPolicy) |
static boolean |
shouldWriteToDiskCache(int networkPolicy) |
static NetworkPolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NetworkPolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NetworkPolicy NO_CACHE
public static final NetworkPolicy NO_STORE
Note: At this time this is only supported if you are using OkHttp.
public static final NetworkPolicy OFFLINE
public static NetworkPolicy[] values()
for (NetworkPolicy c : NetworkPolicy.values()) System.out.println(c);
public static NetworkPolicy valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static boolean shouldReadFromDiskCache(int networkPolicy)
public static boolean shouldWriteToDiskCache(int networkPolicy)
public static boolean isOfflineOnly(int networkPolicy)
Copyright © 2013–2016 Square, Inc.. All rights reserved.