Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

# Builder

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/health/connect/datatypes/ExerciseLap.Builder "View this page in Java")

```
class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.health.connect.datatypes.ExerciseLap.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap.Builder#) |

Builder class for `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap`

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap.Builder#Builder(java.time.Instant,%20java.time.Instant)(startTime: https://developer.android.com/reference/kotlin/java/time/Instant.html#, endTime: https://developer.android.com/reference/kotlin/java/time/Instant.html#)` <br /> |

| Public methods ||
|---|---|
| [ExerciseLap](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap.Builder#build()()` Builds `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap` instance. |
| [ExerciseLap.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap.Builder#) | `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap.Builder#setLength(android.health.connect.datatypes.units.Length)(length: https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Length)` Sets the length of this lap |

## Public constructors

### Builder

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
Builder(
    startTime: Instant, 
    endTime: Instant)
```

| Parameters ||
|---|---|
| `startTime` | [Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#): This value cannot be `null`. |
| `endTime` | [Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#): This value cannot be `null`. |

## Public methods

### build

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
fun build(): ExerciseLap
```

Builds `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap` instance.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap` | This value cannot be `null`. |

### setLength

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in [U Extensions 7](https://developer.android.com/sdkExtensions)

```
fun setLength(length: Length): ExerciseLap.Builder
```

Sets the length of this lap

| Parameters ||
|---|---|
| `length` | [Length](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Length): Length of the lap, in `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Length` unit. Optional field. Valid range: 0-1000000 meters. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseLap.Builder#` | This value cannot be `null`. |