TimerBuilder

public final class TimerBuilder extends IndexableBuilder<TimerBuilder>

Builder to construct an Indexable for a timer.

Constant Summary

String EXPIREDThe timer is expired.
String MISSEDThe timer is missed.
String PAUSEDThe timer is paused.
String RESETThe timer is reset to its initial value.
String STARTEDThe timer is started.
String UNKNOWNThe timer is in an unknown error state.

Public Method Summary

TimerBuilder
setExpireTime(Calendar wallClockExpirationTime)
Sets the wall clock time at which the timer will, or did, expire.
TimerBuilder
setIdentifier(String identifier)
Sets the immutable unique identifier of the timer.
TimerBuilder
setLength(long lengthInMilliseconds)
Sets the total length of the timer when it was created, in milliseconds.
TimerBuilder
setMessage(String message)
Sets the custom message associated with this timer.
TimerBuilder
setRemainingTime(long remainingTimeInMilliseconds)
Sets the amount of time remaining when the timer was started or stopped, in milliseconds.
TimerBuilder
setRingtone(String ringtone)
Sets the ringtone to be played when the timer expires, as a content URI of the media to be played, or AlarmClock.VALUE_RINGTONE_SILENT if no ringtone will be played.
TimerBuilder
setTimerStatus(String status)
Sets the current status of the timer.
TimerBuilder
setVibrate(boolean vibrate)
Sets whether or not to activate the device vibrator when the timer expires.

Inherited Method Summary

Constants

public static final StringEXPIRED

The timer is expired.

Constant Value:"Expired"

public static final StringMISSED

The timer is missed.

Constant Value:"Missed"

public static final StringPAUSED

The timer is paused.

Constant Value:"Paused"

public static final StringRESET

The timer is reset to its initial value.

Constant Value:"Reset"

public static final StringSTARTED

The timer is started.

Constant Value:"Started"

public static final StringUNKNOWN

The timer is in an unknown error state.

Constant Value:"Unknown"

Public Methods

public TimerBuildersetExpireTime(Calendar wallClockExpirationTime)

Sets the wall clock time at which the timer will, or did, expire.

public TimerBuildersetIdentifier(String identifier)

Sets the immutable unique identifier of the timer.

public TimerBuildersetLength(long lengthInMilliseconds)

Sets the total length of the timer when it was created, in milliseconds.

public TimerBuildersetMessage(String message)

Sets the custom message associated with this timer.

public TimerBuildersetRemainingTime(long remainingTimeInMilliseconds)

Sets the amount of time remaining when the timer was started or stopped, in milliseconds.

public TimerBuildersetRingtone(String ringtone)

Sets the ringtone to be played when the timer expires, as a content URI of the media to be played, or AlarmClock.VALUE_RINGTONE_SILENT if no ringtone will be played.

public TimerBuildersetTimerStatus(String status)

Sets the current status of the timer.

Parameters
statusMust be one of { STARTED, PAUSED, EXPIRED, MISSED, RESET, UNKNOWN }.

public TimerBuildersetVibrate(boolean vibrate)

Sets whether or not to activate the device vibrator when the timer expires.