# AlarmInstance

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

*** ** * ** ***


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

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing) ||
|   | ↳ | [androidx.appsearch.builtintypes.AlarmInstance](https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance) |

*** ** * ** ***

AppSearch document representing an `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` entity.

An `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` must be associated with an `https://developer.android.com/reference/androidx/appsearch/builtintypes/Alarm`. It represents a particular point in time for that Alarm. For example, if an Alarm is set to repeat every Monday, then each `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` for it will be the exact Mondays that the Alarm did trigger.

The scheduled time should be timezone independent so that it remains unchanged across timezones. E.g.: An `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` set to fire at 7am GMT should also fire at 7am when the timezone is changed to PST.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/androidx/appsearch/annotation/Document.BuilderProducer public final class https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance.Builder extends https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance.BuilderBase<https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance.Builder>` Builder for `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance`. |
| `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi public class https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance.BuilderBase<T extends https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance.BuilderBase<T>> extends https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing.BuilderBase<T>` |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_DISMISSED() = 3` The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` has been dismissed. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_FIRING() = 2` The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` is firing. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_MISSED() = 5` The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` has been missed. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_SCHEDULED() = 1` The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` is scheduled to fire at some point in the future. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_SNOOZED() = 4` The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` has been snoozed. |
| `static final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_UNKNOWN() = 0` The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` is in an unknown error state. |

| ### Public constructors |
|---|
| `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#AlarmInstance(androidx.appsearch.builtintypes.AlarmInstance.BuilderBase<?>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance.BuilderBase<@https://developer.android.com/reference/androidx/annotation/NonNull ?> builder)` Constructor for `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#getScheduledTime()()` Returns the time that this is expected to fire in ISO 8601 format. |
| `long` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#getSnoozeDurationMillis()()` Returns the length of time in milliseconds the `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` will remain snoozed before it fires again, or -1 if it does not support snoozing. |
| `int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#getStatus()()` Returns the current status. |

### Inherited methods

From [androidx.appsearch.builtintypes.Thing](https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing) `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getAlternateNames()()`

Returns an unmodifiable list of aliases, if any, for this item.
`long` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()()`

Returns the creation timestamp, in milliseconds since Unix epoch, of this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getDescription()()`

Returns a description of this item.
`int` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getDocumentScore()()`

Returns the intrinsic score (or importance) of this item.
`long` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getDocumentTtlMillis()()`

Returns the time-to-live timestamp, in milliseconds since `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getCreationTimestampMillis()`, for this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getId()()`

Returns the unique identifier for this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getImage()()`

Returns the URL for an image of this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getName()()`

Returns the name of this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getNamespace()()`

Returns the namespace (or logical grouping) for this item.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction>` `@https://developer.android.com/reference/androidx/appsearch/app/ExperimentalAppSearchApi
https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getPotentialActions()()`

Returns the actions that can be taken on this object.
`@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/appsearch/builtintypes/Thing#getUrl()()`

Returns the deeplink URL of this item.

## Constants

### STATUS_DISMISSED

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

```
public static final int STATUS_DISMISSED = 3
```

The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` has been dismissed.

### STATUS_FIRING

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

```
public static final int STATUS_FIRING = 2
```

The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` is firing.

### STATUS_MISSED

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

```
public static final int STATUS_MISSED = 5
```

The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` has been missed.

### STATUS_SCHEDULED

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

```
public static final int STATUS_SCHEDULED = 1
```

The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` is scheduled to fire at some point in the future.

### STATUS_SNOOZED

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

```
public static final int STATUS_SNOOZED = 4
```

The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` has been snoozed.

### STATUS_UNKNOWN

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

```
public static final int STATUS_UNKNOWN = 0
```

The `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` is in an unknown error state.

## Public constructors

### AlarmInstance

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

```
@ExperimentalAppSearchApi
public AlarmInstance(@NonNull AlarmInstance.BuilderBase<@NonNull ?> builder)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance.BuilderBase<@https://developer.android.com/reference/androidx/annotation/NonNull ?> builder` | The builder to construct the `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` from. |

## Public methods

### getScheduledTime

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

```
public @NonNull String getScheduledTime()
```

Returns the time that this is expected to fire in ISO 8601 format. E.g.: 2022-01-14T00:00:00

The scheduledTime is a timezone independent date time. When used, it should be converted into a date time in the local timezone.

### getSnoozeDurationMillis

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

```
public long getSnoozeDurationMillis()
```

Returns the length of time in milliseconds the `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance` will remain snoozed before it fires again, or -1 if it does not support snoozing.

### getStatus

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

```
public int getStatus()
```

Returns the current status.

Status can be either `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_UNKNOWN()`, `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_SCHEDULED()`, `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_FIRING()`, `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_DISMISSED()`, `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_SNOOZED()`, or `https://developer.android.com/reference/androidx/appsearch/builtintypes/AlarmInstance#STATUS_MISSED()`.