Class TimeWindow

java.lang.Object
com.cloudinary.android.policy.TimeWindow

public class TimeWindow
extends java.lang.Object
Represents the time window in which the request must be executed. See TimeWindow.Builder for details.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  TimeWindow.Builder
    Constructs a TimeWindow instance
  • Method Summary

    Modifier and Type Method Description
    static TimeWindow getDefault()  
    long getMaxExecutionDelayMillis()
    The maximum time to wait before a request must be executed regardless of the upload policy.
    long getMinLatencyOffsetMillis()
    The minimum time to wait before executing a request.
    static TimeWindow immediate()  
    boolean isImmediate()
    Returns true if the time window is forcing a run within the next minute (i.e.
    boolean isStartNow()
    Returns true if the time window is scheduled to start within the next minute.
    TimeWindow newDeferredWindow​(int minutes)
    Build a new deferred time window instance based on this instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • immediate

      public static TimeWindow immediate()
      Returns:
      An instance of TimeWindow configured to execute a request immediately, ignoring policy constraints.
    • getDefault

      public static TimeWindow getDefault()
      Returns:
      An instance of TimeWindow with default configuration.
    • getMinLatencyOffsetMillis

      public long getMinLatencyOffsetMillis()
      The minimum time to wait before executing a request. This is defined as offset to current time.
    • getMaxExecutionDelayMillis

      public long getMaxExecutionDelayMillis()
      The maximum time to wait before a request must be executed regardless of the upload policy. This is defined as offset to current time.
    • newDeferredWindow

      public TimeWindow newDeferredWindow​(int minutes)
      Build a new deferred time window instance based on this instance.
      Parameters:
      minutes - Minutes to defer by
      Returns:
      The new instance.
    • isStartNow

      public boolean isStartNow()
      Returns true if the time window is scheduled to start within the next minute.
    • isImmediate

      public boolean isImmediate()
      Returns true if the time window is forcing a run within the next minute (i.e. ignoring policy constraints).