# Alarm.Builder

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.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
@Document.BuilderProducer
public final class Alarm.Builder extends Alarm.BuilderBase<Alarm.Builder>
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [androidx.appsearch.builtintypes.Thing.BuilderBase](https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase) |||
|   | ↳ | [androidx.appsearch.builtintypes.Alarm.BuilderBase](https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase)\<[Alarm.Builder](https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.Builder)\> ||
|   |   | ↳ | [androidx.appsearch.builtintypes.Alarm.Builder](https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.Builder) |

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.Builder#Builder(androidx.appsearch.builtintypes.Alarm)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm alarm)` Constructor with all the existing values. |
| `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.Builder#Builder(java.lang.String,java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html id)` Constructor for `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.Builder`. |

### Inherited methods

From [androidx.appsearch.builtintypes.Alarm.BuilderBase](https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase) `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#build()()`

Builds the `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm`.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setBlackoutPeriodEndDate(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html blackoutPeriodEndDate)`

Sets the end time for the blackout period in ISO 8601 format.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setBlackoutPeriodStartDate(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html blackoutPeriodStartDate)`

Sets the start date for the blackout period in ISO 8601 format.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setDaysOfWeek(int...)(
@https://developer.android.com/reference/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://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html int[] daysOfWeek
)`

Sets the scheduled days for repeating.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setEnabled(boolean)(boolean enabled)`

Sets whether or not the `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm` is active.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setHour(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0, to = 23) int hour)`

Sets the hour the `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm` will fire.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setMinute(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0, to = 59) int minute)`

Sets the minute the `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm` will fire.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setNextInstance(androidx.appsearch.builtintypes.AlarmInstance)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance nextInstance)`

Sets the next `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance`.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setOriginatingDevice(int)(int originatingDevice)`

Sets the `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.OriginatingDevice` this alarm belongs to.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setPreviousInstance(androidx.appsearch.builtintypes.AlarmInstance)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance previousInstance)`

Sets the previous `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance`.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setRingtone(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html ringtone)`

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.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm.BuilderBase#setShouldVibrate(boolean)(boolean shouldVibrate)`

Sets whether or not to activate the device vibrator when the `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm` fires.
From [androidx.appsearch.builtintypes.Thing.BuilderBase](https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase) `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#addAlternateName(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html alternateName)`

Adds an alias for the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#addPotentialAction(androidx.appsearch.builtintypes.PotentialAction)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction newPotentialAction)`

Add a new action to the list of potential actions for this document.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#build()()`

Builds a `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing` object.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#clearAlternateNames()()`

Clears the aliases, if any, for the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#clearPotentialActions()()`

Clear all the potential actions for this document.
`void` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#resetIfBuilt()()`

If built, make a copy of previous data for every field so that the builder can be reused.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setAlternateNames(java.util.List<java.lang.String>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> alternateNames)`

Sets a list of aliases for the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setCreationTimestampMillis(long)(long creationTimestampMillis)`

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.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setDescription(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html description)`

Sets the description for the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setDocumentScore(int)(int documentScore)`

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

Sets the time-to-live (TTL) for the current AppSearch document as a duration in milliseconds.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setImage(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html image)`

Sets the URL for an image of the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setName(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html name)`

Sets the name of the item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setPotentialActions(java.util.List<androidx.appsearch.builtintypes.PotentialAction>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction> newPotentialActions)`

Sets a list of potential actions for this document.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase#setUrl(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html url)`

Sets the deeplink URL of the item.

## Public constructors

### Builder

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

```
public Builder(@NonNull Alarm alarm)
```

Constructor with all the existing values.

### Builder

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

```
public Builder(@NonNull String namespace, @NonNull String id)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace` | Namespace for the Document. See `https://developer.android.com/reference/androidx/appsearch/annotation/Document.Namespace`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html id` | Unique identifier for the Document. See `https://developer.android.com/reference/androidx/appsearch/annotation/Document.Id`. |