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 setRepetitionsCount(int repetitionsCount)

Sets the number of repetitions to the current segment.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

Added in API level 34
public Builder (Instant startTime, 
                Instant endTime, 
                int segmentType)

Parameters
startTime Instant: This value cannot be null.

endTime Instant: This value cannot be null.

segmentType int: Value is ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_UNKNOWN, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_BARBELL_SHOULDER_PRESS, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_BENCH_SIT_UP, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_BIKING, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_BIKING_STATIONARY, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_DUMBBELL_CURL_LEFT_ARM, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_DUMBBELL_CURL_RIGHT_ARM, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_DUMBBELL_FRONT_RAISE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_DUMBBELL_LATERAL_RAISE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_DUMBBELL_TRICEPS_EXTENSION_LEFT_ARM, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_DUMBBELL_TRICEPS_EXTENSION_RIGHT_ARM, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_DUMBBELL_TRICEPS_EXTENSION_TWO_ARM, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_FORWARD_TWIST, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_ELLIPTICAL, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_PILATES, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_ROWING_MACHINE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_RUNNING, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_RUNNING_TREADMILL, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_STAIR_CLIMBING, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_STAIR_CLIMBING_MACHINE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_STRETCHING, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SWIMMING_OPEN_WATER, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SWIMMING_POOL, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_UPPER_TWIST, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_WALKING, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_WEIGHTLIFTING, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_WHEELCHAIR, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_OTHER_WORKOUT, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_YOGA, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_ARM_CURL, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_BACK_EXTENSION, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_BALL_SLAM, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_BENCH_PRESS, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_BURPEE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_CRUNCH, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_DEADLIFT, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_DOUBLE_ARM_TRICEPS_EXTENSION, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_DUMBBELL_ROW, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_FRONT_RAISE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_HIP_THRUST, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_HULA_HOOP, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_JUMPING_JACK, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_JUMP_ROPE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_KETTLEBELL_SWING, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_LATERAL_RAISE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_LAT_PULL_DOWN, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_LEG_CURL, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_LEG_EXTENSION, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_LEG_PRESS, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_LEG_RAISE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_LUNGE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_MOUNTAIN_CLIMBER, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_PLANK, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_PULL_UP, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_PUNCH, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SHOULDER_PRESS, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SINGLE_ARM_TRICEPS_EXTENSION, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SIT_UP, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SQUAT, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SWIMMING_FREESTYLE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SWIMMING_BACKSTROKE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SWIMMING_BREASTSTROKE, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SWIMMING_BUTTERFLY, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SWIMMING_MIXED, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_SWIMMING_OTHER, ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_REST, or ExerciseSegmentType.EXERCISE_SEGMENT_TYPE_PAUSE

Public methods

build

Added in API level 34
public ExerciseSegment build ()

Sets the number repetitions to the current segment. Returns ExerciseSegment instance.

Returns
ExerciseSegment This value cannot be null.

setRepetitionsCount

Added in API level 34
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.