# UpdateInfo.Builder

Artifact: [androidx.security:security-state](https://developer.android.com/jetpack/androidx/releases/security) [View Source](https://cs.android.com/search?q=file:androidx/security/state/UpdateInfo.kt+class:androidx.security.state.UpdateInfo.Builder) Added in [1.1.0-rc01](https://developer.android.com/jetpack/androidx/releases/security#1.1.0-rc01)

*** ** * ** ***


```
public final class UpdateInfo.Builder
```

<br />

*** ** * ** ***

Builder class for creating an instance of UpdateInfo.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder#Builder()()` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder#build()()` Builds and returns an UpdateInfo object. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder#setComponent(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html component)` Sets the component associated with the update. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder#setLastCheckTimeMillis(kotlin.Long)(long lastCheckTimeMillis)` Sets the timestamp when this update was checked or discovered. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder#setPublishedDateMillis(kotlin.Long)(long publishedDateMillis)` Sets the publication date of the update. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder` | `https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder#setSecurityPatchLevel(androidx.security.state.SecurityPatchState.SecurityPatchLevel)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/SecurityPatchState.SecurityPatchLevel securityPatchLevel )` Sets the security patch level of the update. |

## Public constructors

### Builder

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

```
public Builder()
```

## Public methods

### build

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

```
public final @NonNull UpdateInfo build()
```

Builds and returns an UpdateInfo object.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo` | The constructed UpdateInfo. |

### setComponent

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

```
public final @NonNull UpdateInfo.Builder setComponent(@NonNull String component)
```

Sets the component associated with the update.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html component` | The component to set. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder` | The builder instance for chaining. |

### setLastCheckTimeMillis

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

```
public final @NonNull UpdateInfo.Builder setLastCheckTimeMillis(long lastCheckTimeMillis)
```

Sets the timestamp when this update was checked or discovered.

| Parameters |
|---|---|
| `long lastCheckTimeMillis` | The timestamp in milliseconds since the epoch. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder` | The builder instance for chaining. |

### setPublishedDateMillis

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

```
public final @NonNull UpdateInfo.Builder setPublishedDateMillis(long publishedDateMillis)
```

Sets the publication date of the update.

| Parameters |
|---|---|
| `long publishedDateMillis` | The timestamp in milliseconds since the epoch. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder` | The builder instance for chaining. |

### setSecurityPatchLevel

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

```
public final @NonNull UpdateInfo.Builder setSecurityPatchLevel(
    @NonNull SecurityPatchState.SecurityPatchLevel securityPatchLevel
)
```

Sets the security patch level of the update.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/SecurityPatchState.SecurityPatchLevel securityPatchLevel` | The `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.SecurityPatchLevel` to set. Depending on the component, this should be a concrete subclass such as `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.DateBasedSecurityPatchLevel` (for SYSTEM and VENDOR) or `https://developer.android.com/reference/androidx/security/state/SecurityPatchState.VersionedSecurityPatchLevel` (for KERNEL). |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/security/state/UpdateInfo.Builder` | The builder instance for chaining. |