public static class

Schedule.Builder

extends Object
java.lang.Object
   ↳ com.urbanairship.automation.Schedule.Builder<T extends com.urbanairship.automation.ScheduleData>

Class Overview

In-app message schedule info builder.

Summary

Public Methods
Builder<T> addTrigger(Trigger trigger)
Adds a trigger.
Builder<T> addTriggers(List<Trigger> triggers)
Adds a list of triggers.
Schedule<T> build()
Builds the in-app message schedule.
Builder<T> setAudience(Audience audience)
Sets the audience.
Builder<T> setDelay(ScheduleDelay delay)
Set a schedule delay.
Builder<T> setEditGracePeriod(long duration, TimeUnit timeUnit)
Sets the edit grace period after a schedule expires or finishes.
Builder<T> setEnd(long end)
Sets the end time in ms.
Builder<T> setGroup(String group)
Sets the group.
Builder<T> setId(String id)
Sets the schedule ID.
Builder<T> setInterval(long duration, TimeUnit timeUnit)
Sets the display interval.
Builder<T> setLimit(int limit)
Sets the display limit.
Builder<T> setMetadata(JsonMap metadata)
Sets the metadata.
Builder<T> setPriority(int priority)
Sets the priority level, in ascending order.
Builder<T> setStart(long start)
Sets the start time in ms.
Builder<T> setTriggers(List<Trigger> triggers)
Sets the list of triggers.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public Builder<T> addTrigger (Trigger trigger)

Adds a trigger.

Parameters
trigger A trigger instance.
Returns
  • The Builder instance.

public Builder<T> addTriggers (List<Trigger> triggers)

Adds a list of triggers.

Parameters
triggers A list of trigger instances.
Returns
  • The Builder instance.

public Schedule<T> build ()

Builds the in-app message schedule.

Returns
  • The new in-app message schedule.
Throws
IllegalArgumentException if no triggers are set, TRIGGER_LIMIT triggers are set, or the start time is set after the end time.

public Builder<T> setAudience (Audience audience)

Sets the audience.

Parameters
audience The audience.
Returns
  • The builder.

public Builder<T> setDelay (ScheduleDelay delay)

Set a schedule delay.

Parameters
delay A ScheduleDelay object.
Returns
  • The Builder instance.

public Builder<T> setEditGracePeriod (long duration, TimeUnit timeUnit)

Sets the edit grace period after a schedule expires or finishes.

Parameters
duration The grace period.
timeUnit The time unit.
Returns
  • The Builder instance.

public Builder<T> setEnd (long end)

Sets the end time in ms.

Parameters
end The end time in ms.
Returns
  • The Builder instance.

public Builder<T> setGroup (String group)

Sets the group.

Parameters
group The group.
Returns
  • The Builder instance.

public Builder<T> setId (String id)

Sets the schedule ID.

Parameters
id The schedule ID.
Returns
  • The builder instance.

public Builder<T> setInterval (long duration, TimeUnit timeUnit)

Sets the display interval.

Parameters
duration The interval.
timeUnit The time unit.
Returns
  • The Builder instance.

public Builder<T> setLimit (int limit)

Sets the display limit.

Parameters
limit The display limit.
Returns
  • The builder instance.

public Builder<T> setMetadata (JsonMap metadata)

Sets the metadata.

Parameters
metadata The metadata.
Returns
  • The builder instance.

public Builder<T> setPriority (int priority)

Sets the priority level, in ascending order.

Parameters
priority The priority level.
Returns
  • The Builder instance.

public Builder<T> setStart (long start)

Sets the start time in ms.

Parameters
start The start time in ms.
Returns
  • The Builder instance.

public Builder<T> setTriggers (List<Trigger> triggers)

Sets the list of triggers.

Parameters
triggers A list of trigger instances.
Returns
  • The Builder instance.