class Alarm.Builder


Builder for Alarm.

Summary

Public constructors

Builder(alarm: Alarm)

Constructor with all the existing values.

Builder(namespace: String, id: String)

Constructor for Alarm.Builder.

Public functions

T
addAlternateName(alternateName: String)

Adds an alias for the item.

T
addPotentialAction(newPotentialAction: PotentialAction)

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

Alarm

Builds the Alarm.

Thing

Builds a Thing object.

T

Clears the aliases, if any, for the item.

T

Clear all the potential actions for this document.

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
setCreationTimestampMillis(creationTimestampMillis: Long)

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

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

Sets the scheduled days for repeating.

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
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
setImage(image: String?)

Sets the URL for an image of the item.

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

Sets the minute the Alarm will fire.

T
setName(name: String?)

Sets the name of the item.

T

Sets the next AlarmInstance.

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.

T
setUrl(url: String?)

Sets the deeplink URL of the item.

Public constructors

Builder

Added in 1.1.0-alpha04
Builder(alarm: Alarm)

Constructor with all the existing values.

Builder

Added in 1.1.0-alpha04
Builder(namespace: String, id: String)

Constructor for Alarm.Builder.

Parameters
namespace: String

Namespace for the Document. See Document.Namespace.

id: String

Unique identifier for the Document. See Document.Id.

Public functions

addAlternateName

Added in 1.1.0-alpha04
fun addAlternateName(alternateName: String): T

Adds an alias for the item.

addPotentialAction

Added in 1.1.0-alpha04
fun addPotentialAction(newPotentialAction: PotentialAction): T

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

build

Added in 1.1.0-alpha04
fun build(): Alarm

Builds the Alarm.

build

Added in 1.1.0-alpha04
fun build(): Thing

Builds a Thing object.

clearAlternateNames

Added in 1.1.0-alpha04
fun clearAlternateNames(): T

Clears the aliases, if any, for the item.

clearPotentialActions

Added in 1.1.0-alpha04
fun clearPotentialActions(): T

Clear all the potential actions for this document.

setBlackoutPeriodEndDate

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

setCreationTimestampMillis

Added in 1.1.0-alpha04
fun setCreationTimestampMillis(creationTimestampMillis: Long): T

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

This timestamp refers to the creation time of the AppSearch entity, not when the document is written into AppSearch.

If not set, then the current timestamp will be used.

See androidx.appsearch.annotation.Document.CreationTimestampMillis for more information on creation timestamp.

setDaysOfWeek

fun setDaysOfWeek(
    daysOfWeek: @IntRange(from = Calendar.SUNDAY, to = Calendar.SATURDAY) IntArray?
): 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.

setDescription

Added in 1.1.0-alpha04
fun setDescription(description: String?): T

Sets the description for the item.

setDocumentScore

Added in 1.1.0-alpha04
fun setDocumentScore(documentScore: Int): T

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

See androidx.appsearch.annotation.Document.Score for more information on score.

setDocumentTtlMillis

Added in 1.1.0-alpha04
fun setDocumentTtlMillis(documentTtlMillis: Long): T

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

The document will be automatically deleted when the TTL expires.

If not set, then the document will never expire.

See androidx.appsearch.annotation.Document.TtlMillis for more information on TTL.

setEnabled

Added in 1.1.0-alpha04
fun setEnabled(enabled: Boolean): T

Sets whether or not the Alarm is active.

setHour

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

setImage

Added in 1.1.0-alpha04
fun setImage(image: String?): T

Sets the URL for an image of the item.

setMinute

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

setName

Added in 1.1.0-alpha04
fun setName(name: String?): T

Sets the name of the item.

setNextInstance

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

setPreviousInstance

Added in 1.1.0-alpha04
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.1.0-alpha04
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.1.0-alpha04
fun setShouldVibrate(shouldVibrate: Boolean): T

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

setUrl

Added in 1.1.0-alpha04
fun setUrl(url: String?): T

Sets the deeplink URL of the item.

If this item can be displayed by any system UI surface, or can be read by another Android package, through one of the androidx.appsearch.app.SetSchemaRequest.Builder methods, this url should act as a deeplink into the activity that can open it. Callers should be able to construct an ACTION_VIEW intent with the url as the setData to view the item inside your application.

See Allowing Other Apps to Start Your Activity for more details on how to make activities in your app open for use by other apps by defining intent filters.

Protected properties

mAlternateNames

protected val mAlternateNames: (Mutable)List<String!>!

mBlackoutPeriodEndDate

protected val mBlackoutPeriodEndDateString!

mBlackoutPeriodStartDate

protected val mBlackoutPeriodStartDateString!

mCreationTimestampMillis

protected val mCreationTimestampMillisLong

mDaysOfWeek

protected val mDaysOfWeekIntArray<Int>!

mDescription

protected val mDescriptionString!

mDocumentScore

protected val mDocumentScoreInt

mDocumentTtlMillis

protected val mDocumentTtlMillisLong

mEnabled

protected val mEnabledBoolean

mHour

protected val mHourInt

mId

protected val mIdString!

mImage

protected val mImageString!

mMinute

protected val mMinuteInt

mName

protected val mNameString!

mNamespace

protected val mNamespaceString!

mNextInstance

protected val mNextInstanceAlarmInstance!

mPotentialActions

protected val mPotentialActions: (Mutable)List<PotentialAction!>!

mPreviousInstance

protected val mPreviousInstanceAlarmInstance!

mRingtone

protected val mRingtoneString!

mShouldVibrate

protected val mShouldVibrateBoolean

mUrl

protected val mUrlString!