public class

ScheduleDelay

extends Object
implements Parcelable
java.lang.Object
   ↳ com.urbanairship.automation.ScheduleDelay

Class Overview

Defines conditions that might delay the execution of a schedule.

Summary

Nested Classes
@interface ScheduleDelay.AppState  
class ScheduleDelay.Builder Builder class. 
Constants
int APP_STATE_ANY Type representing either the foreground or background app state.
int APP_STATE_BACKGROUND Type representing the background app state.
int APP_STATE_FOREGROUND Type representing the foreground app state.
String SECONDS_KEY
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<ScheduleDelay> CREATOR
Protected Constructors
ScheduleDelay(Parcel in)
Public Methods
int describeContents()
int getAppState()
Get the execution app state.
List<Trigger> getCancellationTriggers()
Get the list of cancellation triggers.
String getRegionId()
Get the execution region ID.
List<String> getScreens()
Get the execution screens
long getSeconds()
Gets the delay seconds.
static ScheduleDelay.Builder newBuilder()
Creates a new Builder instance.
static ScheduleDelay parseJson(JsonValue value)
Parses a ScheduleDelay from JSON.
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int APP_STATE_ANY

Type representing either the foreground or background app state.

Constant Value: 1 (0x00000001)

public static final int APP_STATE_BACKGROUND

Type representing the background app state.

Constant Value: 3 (0x00000003)

public static final int APP_STATE_FOREGROUND

Type representing the foreground app state.

Constant Value: 2 (0x00000002)

public static final String SECONDS_KEY

Constant Value: "seconds"

Fields

public static final Creator<ScheduleDelay> CREATOR

Protected Constructors

protected ScheduleDelay (Parcel in)

Public Methods

public int describeContents ()

public int getAppState ()

Get the execution app state.

Returns
  • The execution app state.

public List<Trigger> getCancellationTriggers ()

Get the list of cancellation triggers.

Returns
  • The list of cancellation triggers.

public String getRegionId ()

Get the execution region ID.

Returns
  • The execution region ID.

public List<String> getScreens ()

Get the execution screens

Returns
  • The execution screens.

public long getSeconds ()

Gets the delay seconds.

Returns
  • The delay in seconds.

public static ScheduleDelay.Builder newBuilder ()

Creates a new Builder instance.

Returns
  • The Builder instance.

public static ScheduleDelay parseJson (JsonValue value)

Parses a ScheduleDelay from JSON.

 - "seconds": Optional. The minimum time in seconds that is needed to pass before running the actions.
 - "screen": Optional string or array of strings. Specifies the name of an app screen that the user must
 currently be viewing before the schedule's actions are able to be executed.
 - "app_state": Optional. Specifies the app state that is required before the schedule's actions are able
 to execute. Either "foreground" or "background". Invalid app states will throw a JsonException.
 - "region": Optional. Specifies the ID of a region that the device must currently be in before the
 schedule's actions are able to be executed.
 - "cancellation_triggers": Optional. An array of triggers. Each cancels the pending execution of
 the actions.
 

Parameters
value The schedule delay.
Returns
  • The parsed ScheduleDelay.
Throws
JsonException If the json does not produce a valid ScheduleDelay.

public void writeToParcel (Parcel dest, int flags)