Alarm
@Document(name = "builtin:Alarm")
public class Alarm extends Thing
AppSearch document representing an Alarm entity.
Summary
Nested types |
|---|
@Document.BuilderProducerBuilder for |
Constants |
|
|---|---|
static final int |
The |
static final int |
The |
static final int |
The |
Public methods |
|
|---|---|
@Nullable String |
Returns the end time for the blackout period in ISO 8601 format. |
@Nullable String |
Returns the start date of the blackout period in ISO 8601 format. |
@Nullable int[] |
Returns the scheduled days for repeating. |
@IntRange(from = 0, to = 23) int |
getHour()Returns the hour the |
@IntRange(from = 0, to = 59) int |
Returns the minute the |
@Nullable AlarmInstance |
Returns the next |
int |
Returns the |
@Nullable AlarmInstance |
Returns the previous |
@Nullable String |
Returns the ringtone as a content URI to be played, or |
boolean |
Returns whether or not the |
boolean |
Returns whether or not to activate the device vibrator when the |
Inherited methods |
||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Constants
ORIGINATING_DEVICE_SMART_PHONE
public static final int ORIGINATING_DEVICE_SMART_PHONE = 1
The Alarm belongs to a smart phone device.
ORIGINATING_DEVICE_SMART_WATCH
public static final int ORIGINATING_DEVICE_SMART_WATCH = 2
The Alarm belongs to a smart watch device.
ORIGINATING_DEVICE_UNKNOWN
public static final int ORIGINATING_DEVICE_UNKNOWN = 0
The Alarm belongs to an unknown device.
Public methods
getBlackoutPeriodEndDate
public @Nullable String getBlackoutPeriodEndDate()
Returns the end time for the blackout period in ISO 8601 format. E.g.: 2022-01-14
A blackout period means the Alarm will not fire during this period.
If not set, then it indicates that the blackout period has no end time.
If neither blackoutPeriodStartDate and blackoutPeriodEndDate are set, then the blackout period is not defined.
getBlackoutPeriodStartDate
public @Nullable String getBlackoutPeriodStartDate()
Returns the start date of the blackout period in ISO 8601 format. E.g.: 2022-01-14
A blackout period means the Alarm will not fire during this period.
If not set, then it indicates that the blackout period has no start time.
If neither blackoutPeriodStartDate and blackoutPeriodEndDate are set, then the blackout period is not defined.
getDaysOfWeek
public @Nullable int[] getDaysOfWeek()
Returns the scheduled days for repeating.
Days of the week can be MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, or SUNDAY.
If null, or if the list is empty, then the Alarm does not repeat.
getHour
public @IntRange(from = 0, to = 23) int getHour()
Returns the hour the Alarm will fire.
Hours are specified by integers from 0 to 23.
getMinute
public @IntRange(from = 0, to = 59) int getMinute()
Returns the minute the Alarm will fire.
Minutes are specified by integers from 0 to 59.
getNextInstance
public @Nullable AlarmInstance getNextInstance()
Returns the next AlarmInstance.
The next AlarmInstance is the immediate future instance that is scheduled to fire. If there are no future instances, then null will be returned.
See AlarmInstance.
getOriginatingDevice
public int getOriginatingDevice()
Returns the OriginatingDevice this alarm belongs to.
getPreviousInstance
public @Nullable AlarmInstance getPreviousInstance()
Returns the previous AlarmInstance.
The previous AlarmInstance is most recent past instance that was fired. If there are no past instances, then null will be returned.
See AlarmInstance.
getRingtone
public @Nullable String getRingtone()
Returns the ringtone as a content URI to be played, or VALUE_RINGTONE_SILENT if no ringtone will be played.
shouldVibrate
public boolean shouldVibrate()
Returns whether or not to activate the device vibrator when the Alarm fires.