# Alarm.BuilderBase

Artifact: [androidx.appsearch:appsearch-builtin-types](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/builtintypes/Alarm.java+class:androidx.appsearch.builtintypes.Alarm.BuilderBase) Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

*** ** * ** ***


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

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.appsearch.builtintypes.Thing.BuilderBase](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase)\<T!\> ||
|   | ↳ | [androidx.appsearch.builtintypes.Alarm.BuilderBase](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase) |

Known direct subclasses [Alarm.Builder](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.Builder)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.Builder` | Builder for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm`. |

*** ** * ** ***

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#BuilderBase(androidx.appsearch.builtintypes.Alarm)(alarm: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm)` Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase` with all the existing values. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#BuilderBase(java.lang.String,java.lang.String)(namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#build()()` Builds the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm`. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setBlackoutPeriodEndDate(java.lang.String)(blackoutPeriodEndDate: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets the end time for the blackout period in ISO 8601 format. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setBlackoutPeriodStartDate(java.lang.String)(blackoutPeriodStartDate: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets the start date for the blackout period in ISO 8601 format. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setDaysOfWeek(int...)( daysOfWeek: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = https://developer.android.com/reference/java/util/Calendar.html#SUNDAY, to = https://developer.android.com/reference/java/util/Calendar.html#SATURDAY) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>? )` Sets the scheduled days for repeating. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setEnabled(boolean)(enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether or not the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` is active. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setHour(int)(hour: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 23) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the hour the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` will fire. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setMinute(int)(minute: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 59) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the minute the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` will fire. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setNextInstance(androidx.appsearch.builtintypes.AlarmInstance)(nextInstance: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance?)` Sets the next `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setOriginatingDevice(int)(originatingDevice: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.OriginatingDevice` this alarm belongs to. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setPreviousInstance(androidx.appsearch.builtintypes.AlarmInstance)(previousInstance: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance?)` Sets the previous `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setRingtone(java.lang.String)(ringtone: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` Sets the content URI for the ringtone to be played, or `https://developer.android.com/reference/android/provider/AlarmClock.html#VALUE_RINGTONE_SILENT` if no ringtone will be played. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase#setShouldVibrate(boolean)(shouldVibrate: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether or not to activate the device vibrator when the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` fires. |

### Inherited functions

From [androidx.appsearch.builtintypes.Thing.BuilderBase](https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase) `T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#addAlternateName(java.lang.String)(alternateName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`

Adds an alias for the item.
`T` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#addPotentialAction(androidx.appsearch.builtintypes.PotentialAction)(newPotentialAction: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/PotentialAction)`

Add a new action to the list of potential actions for this document.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#clearAlternateNames()()`

Clears the aliases, if any, for the item.
`T` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#clearPotentialActions()()`

Clear all the potential actions for this document.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#resetIfBuilt()()`

If built, make a copy of previous data for every field so that the builder can be reused.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setAlternateNames(java.util.List<java.lang.String>)(alternateNames: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>?)`

Sets a list of aliases for the item.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setCreationTimestampMillis(long)(creationTimestampMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`

Sets the creation timestamp for the current AppSearch entity, in milliseconds using the `https://developer.android.com/reference/java/lang/System.html#currentTimeMillis()` time base.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setDescription(java.lang.String)(description: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)`

Sets the description for the item.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setDocumentScore(int)(documentScore: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Sets the user-provided opaque document score of the current AppSearch document, which can be used for ranking using `https://developer.android.com/reference/kotlin/androidx/appsearch/app/SearchSpec#RANKING_STRATEGY_DOCUMENT_SCORE()`.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setDocumentTtlMillis(long)(documentTtlMillis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`

Sets the time-to-live (TTL) for the current AppSearch document as a duration in milliseconds.
`T` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setImage(java.lang.String)(image: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)`

Sets the URL for an image of the item.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setName(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)`

Sets the name of the item.
`T` `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setPotentialActions(java.util.List<androidx.appsearch.builtintypes.PotentialAction>)(
newPotentialActions: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/PotentialAction!>?
)`

Sets a list of potential actions for this document.
`T` `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Thing.BuilderBase#setUrl(java.lang.String)(url: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)`

Sets the deeplink URL of the item.

## Public constructors

### BuilderBase

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
BuilderBase(alarm: Alarm)
```

Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase` with all the existing values.

| Parameters |
|---|---|
| `alarm: https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` | The existing `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` to copy values from. |

### BuilderBase

```
BuilderBase(namespace: String, id: String)
```

Constructor for `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.BuilderBase`.

| Parameters |
|---|---|
| `namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Namespace for the Document. See `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document.Namespace`. |
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Unique identifier for the Document. See `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document.Id`. |

## Public functions

### build

```
fun build(): Alarm
```

Builds the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm`.

### setBlackoutPeriodEndDate

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#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 `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/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](https://developer.android.com/jetpack/androidx/releases/appsearch#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 `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/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 `https://developer.android.com/reference/java/util/Calendar.html#MONDAY`, `https://developer.android.com/reference/java/util/Calendar.html#TUESDAY`, `https://developer.android.com/reference/java/util/Calendar.html#WEDNESDAY`, `https://developer.android.com/reference/java/util/Calendar.html#THURSDAY`, `https://developer.android.com/reference/java/util/Calendar.html#FRIDAY`, `https://developer.android.com/reference/java/util/Calendar.html#SATURDAY`, or `https://developer.android.com/reference/java/util/Calendar.html#SUNDAY`.

If not set, or if the list is empty, then the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` does not repeat.

### setEnabled

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
fun setEnabled(enabled: Boolean): T
```

Sets whether or not the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` is active.

### setHour

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

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

Sets the hour the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` will fire.

Hours are specified by integers from 0 to 23.

### setMinute

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

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

Sets the minute the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` will fire.

Minutes are specified by integers from 0 to 59.

### setNextInstance

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
fun setNextInstance(nextInstance: AlarmInstance?): T
```

Sets the next `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`.

The next `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` is the immediate future instance that is scheduled to fire. If not set, then there are no future instances.

See `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`.

### setOriginatingDevice

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
fun setOriginatingDevice(originatingDevice: Int): T
```

Sets the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm.OriginatingDevice` this alarm belongs to.

### setPreviousInstance

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
fun setPreviousInstance(previousInstance: AlarmInstance?): T
```

Sets the previous `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`.

The previous `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance` is most recent past instance that was fired. If not set, then there are no past instances.

See `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/AlarmInstance`.

### setRingtone

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
fun setRingtone(ringtone: String?): T
```

Sets the content URI for the ringtone to be played, or `https://developer.android.com/reference/android/provider/AlarmClock.html#VALUE_RINGTONE_SILENT` if no ringtone will be played.

### setShouldVibrate

Added in [1.2.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appsearch#1.2.0-alpha02)

```
fun setShouldVibrate(shouldVibrate: Boolean): T
```

Sets whether or not to activate the device vibrator when the `https://developer.android.com/reference/kotlin/androidx/appsearch/builtintypes/Alarm` fires.