@ExperimentalAppSearchApi
class Alarm.BuilderBase<T : Alarm.BuilderBase<T!>?> : Thing.BuilderBase

Known direct subclasses
Alarm.Builder

Builder for Alarm.


Summary

Public constructors

Constructor for Alarm.BuilderBase with all the existing values.

BuilderBase(namespace: String, id: String)

Constructor for Alarm.BuilderBase.

Public functions

Alarm

Builds the Alarm.

T
setBlackoutPeriodEndDate(blackoutPeriodEndDate: String?)

Sets the end time for the blackout period in ISO 8601 format.

T
setBlackoutPeriodStartDate(blackoutPeriodStartDate: String?)

Sets the start date for the blackout period in ISO 8601 format.

T
setDaysOfWeek(
    daysOfWeek: @IntRange(from = Calendar.SUNDAY, to = Calendar.SATURDAY) IntArray<Int>?
)

Sets the scheduled days for repeating.

T
setEnabled(enabled: Boolean)

Sets whether or not the Alarm is active.

T
setHour(hour: @IntRange(from = 0, to = 23) Int)

Sets the hour the Alarm will fire.

T
setMinute(minute: @IntRange(from = 0, to = 59) Int)

Sets the minute the Alarm will fire.

T

Sets the next AlarmInstance.

T
setOriginatingDevice(originatingDevice: Int)

Sets the OriginatingDevice this alarm belongs to.

T
setPreviousInstance(previousInstance: AlarmInstance?)

Sets the previous AlarmInstance.

T
setRingtone(ringtone: String?)

Sets the content URI for the ringtone to be played, or VALUE_RINGTONE_SILENT if no ringtone will be played.

T
setShouldVibrate(shouldVibrate: Boolean)

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

Inherited functions

From androidx.appsearch.builtintypes.Thing.BuilderBase
T
addAlternateName(alternateName: String)

Adds an alias for the item.

T

Add a new action to the list of potential actions for this document.

T

Clears the aliases, if any, for the item.

T

Clear all the potential actions for this document.

Unit

If built, make a copy of previous data for every field so that the builder can be reused.

T
setAlternateNames(alternateNames: (Mutable)List<String!>?)

Sets a list of aliases for the item.

T
setCreationTimestampMillis(creationTimestampMillis: Long)

Sets the creation timestamp for the current AppSearch entity, in milliseconds using the currentTimeMillis time base.

T
setDescription(description: String?)

Sets the description for the item.

T
setDocumentScore(documentScore: Int)

Sets the user-provided opaque document score of the current AppSearch document, which can be used for ranking using RANKING_STRATEGY_DOCUMENT_SCORE.

T
setDocumentTtlMillis(documentTtlMillis: Long)

Sets the time-to-live (TTL) for the current AppSearch document as a duration in milliseconds.

T

Sets the URL for an image of the item.

T
setName(name: String?)

Sets the name of the item.

T

Sets a list of potential actions for this document.

T
setUrl(url: String?)

Sets the deeplink URL of the item.

Public constructors

BuilderBase

Added in 1.2.0-alpha02
BuilderBase(alarm: Alarm)

Constructor for Alarm.BuilderBase with all the existing values.

Parameters
alarm: Alarm

The existing Alarm to copy values from.

BuilderBase

BuilderBase(namespace: String, id: String)

Constructor for Alarm.BuilderBase.

Parameters
namespace: String

Namespace for the Document. See Document.Namespace.

id: String

Unique identifier for the Document. See Document.Id.

Public functions

build

fun build(): Alarm

Builds the Alarm.

setBlackoutPeriodEndDate

Added in 1.2.0-alpha02
fun setBlackoutPeriodEndDate(blackoutPeriodEndDate: String?): T

Sets 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.

setBlackoutPeriodStartDate

Added in 1.2.0-alpha02
fun setBlackoutPeriodStartDate(blackoutPeriodStartDate: String?): T

Sets the start date 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 start time.

If neither blackoutPeriodStartDate and blackoutPeriodEndDate are set, then the blackout period is not defined.

setDaysOfWeek

fun setDaysOfWeek(
    daysOfWeek: @IntRange(from = Calendar.SUNDAY, to = Calendar.SATURDAY) IntArray<Int>?
): T

Sets the scheduled days for repeating.

Days of the week can be MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, or SUNDAY.

If not set, or if the list is empty, then the Alarm does not repeat.

setEnabled

Added in 1.2.0-alpha02
fun setEnabled(enabled: Boolean): T

Sets whether or not the Alarm is active.

setHour

Added in 1.2.0-alpha02
fun setHour(hour: @IntRange(from = 0, to = 23) Int): T

Sets the hour the Alarm will fire.

Hours are specified by integers from 0 to 23.

setMinute

Added in 1.2.0-alpha02
fun setMinute(minute: @IntRange(from = 0, to = 59) Int): T

Sets the minute the Alarm will fire.

Minutes are specified by integers from 0 to 59.

setNextInstance

Added in 1.2.0-alpha02
fun setNextInstance(nextInstance: AlarmInstance?): T

Sets the next AlarmInstance.

The next AlarmInstance is the immediate future instance that is scheduled to fire. If not set, then there are no future instances.

See AlarmInstance.

setOriginatingDevice

Added in 1.2.0-alpha02
fun setOriginatingDevice(originatingDevice: Int): T

Sets the OriginatingDevice this alarm belongs to.

setPreviousInstance

Added in 1.2.0-alpha02
fun setPreviousInstance(previousInstance: AlarmInstance?): T

Sets the previous AlarmInstance.

The previous AlarmInstance is most recent past instance that was fired. If not set, then there are no past instances.

See AlarmInstance.

setRingtone

Added in 1.2.0-alpha02
fun setRingtone(ringtone: String?): T

Sets the content URI for the ringtone to be played, or VALUE_RINGTONE_SILENT if no ringtone will be played.

setShouldVibrate

Added in 1.2.0-alpha02
fun setShouldVibrate(shouldVibrate: Boolean): T

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