@Document(name = "builtin:Alarm")
public class Alarm extends Thing


AppSearch document representing an Alarm entity.

Summary

Nested types

public final class Alarm.Builder

Builder for Alarm.

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

Returns the hour the Alarm will fire.

@IntRange(from = 0, to = 59) int

Returns the minute the Alarm will fire.

@Nullable AlarmInstance

Returns the next AlarmInstance.

@Nullable AlarmInstance

Returns the previous AlarmInstance.

@Nullable String

Returns the ringtone as a content URI to be played, or VALUE_RINGTONE_SILENT if no ringtone will be played.

boolean

Returns whether or not the Alarm is active.

boolean

Returns whether or not to activate the device vibrator when the Alarm fires.

Inherited methods

From androidx.appsearch.builtintypes.Thing
@NonNull List<String>

Returns an unmodifiable list of aliases, if any, for this item.

long

Returns the creation timestamp, in milliseconds since Unix epoch, of this item.

@Nullable String

Returns a description of this item.

int

Returns the intrinsic score (or importance) of this item.

long

Returns the time-to-live timestamp, in milliseconds since getCreationTimestampMillis, for this item.

@NonNull String

Returns the unique identifier for this item.

@Nullable String

Returns the URL for an image of this item.

@Nullable String

Returns the name of this item.

@NonNull String

Returns the namespace (or logical grouping) for this item.

@NonNull List<PotentialAction>

Returns the actions that can be taken on this object.

@Nullable String

Returns the deeplink URL of this item.

Public methods

getBlackoutPeriodEndDate

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
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.

getPreviousInstance

Added in 1.1.0-alpha04
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

Added in 1.1.0-alpha04
public @Nullable String getRingtone()

Returns the ringtone as a content URI to be played, or VALUE_RINGTONE_SILENT if no ringtone will be played.

isEnabled

Added in 1.1.0-alpha04
public boolean isEnabled()

Returns whether or not the Alarm is active.

shouldVibrate

Added in 1.1.0-alpha04
public boolean shouldVibrate()

Returns whether or not to activate the device vibrator when the Alarm fires.