Package com.cloudinary.android.policy
Class UploadPolicy.Builder
java.lang.Object
com.cloudinary.android.policy.UploadPolicy.Builder
- Enclosing class:
- UploadPolicy
public static class UploadPolicy.Builder
extends java.lang.Object
A utility class to construct an instance of
UploadPolicy.-
Constructor Summary
Constructors Constructor Description Builder() -
Method Summary
Modifier and Type Method Description TbackoffCriteria(long backoffMs, UploadPolicy.BackoffPolicy backoffPolicy)Backoff behaviour for rescheduled requests.UploadPolicybuild()TmaxRetries(int maxRetries)Maximum times to retry a request if it fails.TnetworkPolicy(UploadPolicy.NetworkType networkPolicy)UploadPolicy.NetworkTyperequired to execute the request.TrequiresCharging(boolean requiresCharging)Whether charging is required to execute the request.TrequiresIdle(boolean requiresIdle)Whether the phone needs to be idle to execute the request.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
networkPolicy
UploadPolicy.NetworkTyperequired to execute the request.- Returns:
- Itself for chaining.
-
requiresCharging
public T requiresCharging(boolean requiresCharging)Whether charging is required to execute the request.- Returns:
- Itself for chaining.
-
requiresIdle
public T requiresIdle(boolean requiresIdle)Whether the phone needs to be idle to execute the request.- Returns:
- Itself for chaining.
-
maxRetries
public T maxRetries(int maxRetries)Maximum times to retry a request if it fails.- Returns:
- Itself for chaining.
-
backoffCriteria
Backoff behaviour for rescheduled requests.- Parameters:
backoffMs- The initial interval to wait when the job has been rescheduled.backoffPolicy- Is either linear or exponential.- Returns:
- Itself for chaining.
-
build
- Returns:
- An instance of
UploadPolicyget the requested configuration.
-