# ExerciseSegment.Builder

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

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/health/connect/datatypes/ExerciseSegment.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.ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) |

Builder class for[ExerciseSegment](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment)

## Summary

|                                                                                                                                                                                                                                     Public constructors                                                                                                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#Builder(java.time.Instant,%20java.time.Instant,%20kotlin.Int))`(`startTime:` `[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)`, `endTime:` `[Instant](https://developer.android.com/reference/kotlin/java/time/Instant.html#)`, `segmentType:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> |

|                                                                                                                                                                                                                                               Public methods                                                                                                                                                                                                                                               ||
|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ExerciseSegment](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment)                  | [build](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#build())`()` Sets the number repetitions to the current segment.                                                                                                                                                                                      |
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | [clearRateOfPerceivedExertion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#clearRateOfPerceivedExertion())`()` Clears the rate of perceived exertion for this exercise segment.                                                                                                                           |
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | [clearSetIndex](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#clearSetIndex())`()` Clears the set index for this exercise segment.                                                                                                                                                                          |
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | [clearWeight](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#clearWeight())`()` Clears the weight for this exercise segment.                                                                                                                                                                                 |
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | [setRateOfPerceivedExertion](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#setRateOfPerceivedExertion(kotlin.Float))`(`rateOfPerceivedExertion:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` Sets rate of perceived exertion (RPE) used during the exercise segment. |
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | [setRepetitionsCount](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#setRepetitionsCount(kotlin.Int))`(`repetitionsCount:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the number of repetitions to the current segment.                                             |
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | [setSetIndex](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#setSetIndex(kotlin.Int))`(`setIndex:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the set index for this exercise segment.                                                                              |
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | [setWeight](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#setWeight(android.health.connect.datatypes.units.Mass))`(`weight:` `[Mass](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Mass)`)` Sets the weight associated with this exercise segment.                  |

## Public constructors

### Builder

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

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

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          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`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `segmentType` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_UNKNOWN](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_UNKNOWN:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BARBELL_SHOULDER_PRESS](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BARBELL_SHOULDER_PRESS:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BENCH_SIT_UP](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BENCH_SIT_UP:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BIKING](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BIKING:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BIKING_STATIONARY](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BIKING_STATIONARY:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_CURL_LEFT_ARM](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_CURL_LEFT_ARM:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_CURL_RIGHT_ARM](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_CURL_RIGHT_ARM:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_FRONT_RAISE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_FRONT_RAISE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_LATERAL_RAISE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_LATERAL_RAISE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_TRICEPS_EXTENSION_LEFT_ARM](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_TRICEPS_EXTENSION_LEFT_ARM:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_TRICEPS_EXTENSION_RIGHT_ARM](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_TRICEPS_EXTENSION_RIGHT_ARM:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_TRICEPS_EXTENSION_TWO_ARM](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_TRICEPS_EXTENSION_TWO_ARM:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_FORWARD_TWIST](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_FORWARD_TWIST:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_ELLIPTICAL](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_ELLIPTICAL:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_PILATES](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_PILATES:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_ROWING_MACHINE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_ROWING_MACHINE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_RUNNING](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_RUNNING:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_RUNNING_TREADMILL](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_RUNNING_TREADMILL:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_STAIR_CLIMBING](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_STAIR_CLIMBING:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_STAIR_CLIMBING_MACHINE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_STAIR_CLIMBING_MACHINE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_STRETCHING](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_STRETCHING:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_OPEN_WATER](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_OPEN_WATER:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_POOL](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_POOL:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_UPPER_TWIST](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_UPPER_TWIST:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_WALKING](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_WALKING:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_WEIGHTLIFTING](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_WEIGHTLIFTING:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_WHEELCHAIR](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_WHEELCHAIR:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_OTHER_WORKOUT](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_OTHER_WORKOUT:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_YOGA](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_YOGA:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_ARM_CURL](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_ARM_CURL:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BACK_EXTENSION](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BACK_EXTENSION:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BALL_SLAM](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BALL_SLAM:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BENCH_PRESS](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BENCH_PRESS:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BURPEE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_BURPEE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_CRUNCH](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_CRUNCH:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DEADLIFT](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DEADLIFT:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DOUBLE_ARM_TRICEPS_EXTENSION](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DOUBLE_ARM_TRICEPS_EXTENSION:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_ROW](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_DUMBBELL_ROW:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_FRONT_RAISE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_FRONT_RAISE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_HIP_THRUST](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_HIP_THRUST:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_HULA_HOOP](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_HULA_HOOP:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_JUMPING_JACK](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_JUMPING_JACK:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_JUMP_ROPE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_JUMP_ROPE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_KETTLEBELL_SWING](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_KETTLEBELL_SWING:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LATERAL_RAISE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LATERAL_RAISE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LAT_PULL_DOWN](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LAT_PULL_DOWN:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LEG_CURL](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LEG_CURL:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LEG_EXTENSION](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LEG_EXTENSION:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LEG_PRESS](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LEG_PRESS:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LEG_RAISE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LEG_RAISE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LUNGE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_LUNGE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_MOUNTAIN_CLIMBER](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_MOUNTAIN_CLIMBER:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_PLANK](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_PLANK:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_PULL_UP](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_PULL_UP:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_PUNCH](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_PUNCH:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SHOULDER_PRESS](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SHOULDER_PRESS:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SINGLE_ARM_TRICEPS_EXTENSION](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SINGLE_ARM_TRICEPS_EXTENSION:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SIT_UP](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SIT_UP:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SQUAT](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SQUAT:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_FREESTYLE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_FREESTYLE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_BACKSTROKE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_BACKSTROKE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_BREASTSTROKE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_BREASTSTROKE:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_BUTTERFLY](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_BUTTERFLY:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_MIXED](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_MIXED:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_OTHER](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_SWIMMING_OTHER:kotlin.Int),[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_REST](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_REST:kotlin.Int), or[android.health.connect.datatypes.ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_PAUSE](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegmentType#EXERCISE_SEGMENT_TYPE_PAUSE:kotlin.Int) |

## Public methods

### build

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

```
fun build(): ExerciseSegment
```

Sets the number repetitions to the current segment. Returns[ExerciseSegment](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment)instance.

|                                                                     Return                                                                      ||
|--------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExerciseSegment](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment) | This value cannot be`null`. |

### clearRateOfPerceivedExertion

Added in[API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun clearRateOfPerceivedExertion(): ExerciseSegment.Builder
```

Clears the rate of perceived exertion for this exercise segment.

Returns builder instance with rate of perceived exertion unset.

|                                                                              Return                                                                              ||
|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | This value cannot be`null`. |

### clearSetIndex

Added in[API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun clearSetIndex(): ExerciseSegment.Builder
```

Clears the set index for this exercise segment.

Returns builder instance with set index unset.

|                                                                              Return                                                                              ||
|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | This value cannot be`null`. |

### clearWeight

Added in[API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun clearWeight(): ExerciseSegment.Builder
```

Clears the weight for this exercise segment.

Returns builder instance with weight unset.

|                                                                              Return                                                                              ||
|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | This value cannot be`null`. |

### setRateOfPerceivedExertion

Added in[API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setRateOfPerceivedExertion(rateOfPerceivedExertion: Float): ExerciseSegment.Builder
```

Sets rate of perceived exertion (RPE) used during the exercise segment.

Values correspond to the Borg CR10 RPE scale and must be in the range 0 to 10 inclusive. 0: No exertion (at rest) 1: Very light 2-3: Light 4-5: Moderate 6-7: Hard 8-9: Very hard 10: Maximum effort

Returns builder instance with rate of perceived exertion set.

|                                                                     Parameters                                                                      ||
|---------------------------|--------------------------------------------------------------------------------------------------------------------------|
| `rateOfPerceivedExertion` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):Value is between 0.0f and 10.0f inclusive |

|                                                                              Return                                                                              ||
|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | This value cannot be`null`. |

### setRepetitionsCount

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

```
fun setRepetitionsCount(repetitionsCount: Int): ExerciseSegment.Builder
```

Sets the number of repetitions to the current segment. Returns builder instance with repetitions count set.

|                                                      Parameters                                                      ||
|--------------------|--------------------------------------------------------------------------------------------------|
| `repetitionsCount` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is 0 or greater |

|                                                                              Return                                                                              ||
|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | This value cannot be`null`. |

### setSetIndex

Added in[API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setSetIndex(setIndex: Int): ExerciseSegment.Builder
```

Sets the set index for this exercise segment.

The set index must be a non-negative integer, and should start at zero.

Set index represents the position of this set relative to other sets in the session. For instance, if an exercise has three sets, they will have setIndex values of 0, 1, and 2 respectively.

Multiple segments may be part of a single set, for example if a collection of activities are considered to be a single set, in which case those segments would have the same set index.

The set index is may also go back to zero in a single`ExerciseSession`. For example, if three sets of one activity are completed followed by three sets of another, setIndex values of 0, 1, 2, 0, 1, 2 would be expected for those segments.

Returns builder instance with set index set.

|                                                  Parameters                                                  ||
|------------|--------------------------------------------------------------------------------------------------|
| `setIndex` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is 0 or greater |

|                                                                              Return                                                                              ||
|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | This value cannot be`null`. |

### setWeight

Added in[API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setWeight(weight: Mass): ExerciseSegment.Builder
```

Sets the weight associated with this exercise segment.

Weight must be at least zero and not more than 2500kg.

Returns builder instance with weight set.

|                                                                Parameters                                                                ||
|----------|--------------------------------------------------------------------------------------------------------------------------------|
| `weight` | [Mass](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/units/Mass):This value cannot be`null`. |

|                                                                              Return                                                                              ||
|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExerciseSegment.Builder](https://developer.android.com/reference/kotlin/android/health/connect/datatypes/ExerciseSegment.Builder#) | This value cannot be`null`. |