ExerciseSegment.Builder
public
static
final
class
ExerciseSegment.Builder
extends Object
java.lang.Object | |
↳ | android.health.connect.datatypes.ExerciseSegment.Builder |
Builder class for ExerciseSegment
Summary
Public constructors | |
---|---|
Builder(Instant startTime, Instant endTime, int segmentType)
|
Public methods | |
---|---|
ExerciseSegment
|
build()
Sets the number repetitions to the current segment. |
ExerciseSegment.Builder
|
clearRateOfPerceivedExertion()
Clears the rate of perceived exertion for this exercise segment. |
ExerciseSegment.Builder
|
clearSetIndex()
Clears the set index for this exercise segment. |
ExerciseSegment.Builder
|
clearWeight()
Clears the weight for this exercise segment. |
ExerciseSegment.Builder
|
setRateOfPerceivedExertion(float rateOfPerceivedExertion)
Sets rate of perceived exertion (RPE) used during the exercise segment. |
ExerciseSegment.Builder
|
setRepetitionsCount(int repetitionsCount)
Sets the number of repetitions to the current segment. |
ExerciseSegment.Builder
|
setSetIndex(int setIndex)
Sets the set index for this exercise segment. |
ExerciseSegment.Builder
|
setWeight(Mass weight)
Sets the weight associated with this exercise segment. |
Inherited methods | |
---|---|
Public constructors
Builder
public Builder (Instant startTime, Instant endTime, int segmentType)
Public methods
build
public ExerciseSegment build ()
Sets the number repetitions to the current segment. Returns ExerciseSegment
instance.
Returns | |
---|---|
ExerciseSegment |
This value cannot be null . |
clearRateOfPerceivedExertion
public ExerciseSegment.Builder clearRateOfPerceivedExertion ()
Clears the rate of perceived exertion for this exercise segment.
Returns builder instance with rate of perceived exertion unset.
Returns | |
---|---|
ExerciseSegment.Builder |
This value cannot be null . |
clearSetIndex
public ExerciseSegment.Builder clearSetIndex ()
Clears the set index for this exercise segment.
Returns builder instance with set index unset.
Returns | |
---|---|
ExerciseSegment.Builder |
This value cannot be null . |
clearWeight
public ExerciseSegment.Builder clearWeight ()
Clears the weight for this exercise segment.
Returns builder instance with weight unset.
Returns | |
---|---|
ExerciseSegment.Builder |
This value cannot be null . |
setRateOfPerceivedExertion
public ExerciseSegment.Builder setRateOfPerceivedExertion (float rateOfPerceivedExertion)
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 : Value is between 0.0f and 10.0f inclusive |
Returns | |
---|---|
ExerciseSegment.Builder |
This value cannot be null . |
setRepetitionsCount
public ExerciseSegment.Builder setRepetitionsCount (int repetitionsCount)
Sets the number of repetitions to the current segment. Returns builder instance with repetitions count set.
Parameters | |
---|---|
repetitionsCount |
int : Value is 0 or greater |
Returns | |
---|---|
ExerciseSegment.Builder |
This value cannot be null . |
setSetIndex
public ExerciseSegment.Builder setSetIndex (int setIndex)
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 : Value is 0 or greater |
Returns | |
---|---|
ExerciseSegment.Builder |
This value cannot be null . |
setWeight
public ExerciseSegment.Builder setWeight (Mass weight)
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 : This value cannot be null . |
Returns | |
---|---|
ExerciseSegment.Builder |
This value cannot be null . |