PlannedExerciseSessionRecord.Builder


public static final class PlannedExerciseSessionRecord.Builder
extends Object

java.lang.Object
   ↳ android.health.connect.datatypes.PlannedExerciseSessionRecord.Builder


Builder class for PlannedExerciseSessionRecord.

Summary

Public constructors

Builder(Metadata metadata, int exerciseType, Instant startTime, Instant endTime)
Builder(Metadata metadata, int exerciseType, LocalDate startDate, Duration duration)

Public methods

PlannedExerciseSessionRecord.Builder addBlock(PlannedExerciseBlock block)

Adds a block to this planned session..

PlannedExerciseSessionRecord build()

Returns PlannedExerciseSessionRecord.

PlannedExerciseSessionRecord.Builder clearBlocks()

Clears the blocks of this planned session.

PlannedExerciseSessionRecord.Builder clearEndZoneOffset()

Sets the start zone offset of this record to system default.

PlannedExerciseSessionRecord.Builder clearStartZoneOffset()

Sets the start zone offset of this record to system default.

PlannedExerciseSessionRecord.Builder setBlocks(List<PlannedExerciseBlock> blocks)

Sets the blocks of this planned session.

PlannedExerciseSessionRecord.Builder setEndTime(Instant endTime)

Sets the planned end time of the session.

PlannedExerciseSessionRecord.Builder setEndZoneOffset(ZoneOffset endZoneOffset)

Sets the zone offset of when the workout should end.

PlannedExerciseSessionRecord.Builder setExerciseType(int exerciseType)

Sets the exercise type.

PlannedExerciseSessionRecord.Builder setMetadata(Metadata metadata)

Set the metadata for the record.

PlannedExerciseSessionRecord.Builder setNotes(CharSequence notes)

Sets notes for this activity.

PlannedExerciseSessionRecord.Builder setStartTime(Instant startTime)

Sets the planned start time of the session.

PlannedExerciseSessionRecord.Builder setStartZoneOffset(ZoneOffset startZoneOffset)

Sets the zone offset of when the workout should start.

PlannedExerciseSessionRecord.Builder setTitle(CharSequence title)

Sets a title of this planned session.

Inherited methods

Public constructors

Builder

public Builder (Metadata metadata, 
                int exerciseType, 
                Instant startTime, 
                Instant endTime)

Parameters
metadata Metadata: Metadata to be associated with the record. See Metadata. This value cannot be null.

exerciseType int: Type of exercise (e.g. walking, swimming). Allowed values: ExerciseSessionType. Value is ExerciseSessionType.EXERCISE_SESSION_TYPE_UNKNOWN, ExerciseSessionType.EXERCISE_SESSION_TYPE_BADMINTON, ExerciseSessionType.EXERCISE_SESSION_TYPE_BASEBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_BASKETBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_BIKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_BIKING_STATIONARY, ExerciseSessionType.EXERCISE_SESSION_TYPE_BOOT_CAMP, ExerciseSessionType.EXERCISE_SESSION_TYPE_BOXING, ExerciseSessionType.EXERCISE_SESSION_TYPE_CALISTHENICS, ExerciseSessionType.EXERCISE_SESSION_TYPE_CRICKET, ExerciseSessionType.EXERCISE_SESSION_TYPE_DANCING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ELLIPTICAL, ExerciseSessionType.EXERCISE_SESSION_TYPE_EXERCISE_CLASS, ExerciseSessionType.EXERCISE_SESSION_TYPE_FENCING, ExerciseSessionType.EXERCISE_SESSION_TYPE_FOOTBALL_AMERICAN, ExerciseSessionType.EXERCISE_SESSION_TYPE_FOOTBALL_AUSTRALIAN, ExerciseSessionType.EXERCISE_SESSION_TYPE_FRISBEE_DISC, ExerciseSessionType.EXERCISE_SESSION_TYPE_GOLF, ExerciseSessionType.EXERCISE_SESSION_TYPE_GUIDED_BREATHING, ExerciseSessionType.EXERCISE_SESSION_TYPE_GYMNASTICS, ExerciseSessionType.EXERCISE_SESSION_TYPE_HANDBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING, ExerciseSessionType.EXERCISE_SESSION_TYPE_HIKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ICE_HOCKEY, ExerciseSessionType.EXERCISE_SESSION_TYPE_ICE_SKATING, ExerciseSessionType.EXERCISE_SESSION_TYPE_MARTIAL_ARTS, ExerciseSessionType.EXERCISE_SESSION_TYPE_PADDLING, ExerciseSessionType.EXERCISE_SESSION_TYPE_PARAGLIDING, ExerciseSessionType.EXERCISE_SESSION_TYPE_PILATES, ExerciseSessionType.EXERCISE_SESSION_TYPE_RACQUETBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROCK_CLIMBING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROLLER_HOCKEY, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROWING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROWING_MACHINE, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUGBY, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUNNING, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUNNING_TREADMILL, ExerciseSessionType.EXERCISE_SESSION_TYPE_SAILING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SCUBA_DIVING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SKATING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SKIING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SNOWBOARDING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SNOWSHOEING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SOCCER, ExerciseSessionType.EXERCISE_SESSION_TYPE_SOFTBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_SQUASH, ExerciseSessionType.EXERCISE_SESSION_TYPE_STAIR_CLIMBING, ExerciseSessionType.EXERCISE_SESSION_TYPE_STAIR_CLIMBING_MACHINE, ExerciseSessionType.EXERCISE_SESSION_TYPE_STRENGTH_TRAINING, ExerciseSessionType.EXERCISE_SESSION_TYPE_STRETCHING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SURFING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SWIMMING_OPEN_WATER, ExerciseSessionType.EXERCISE_SESSION_TYPE_SWIMMING_POOL, ExerciseSessionType.EXERCISE_SESSION_TYPE_TABLE_TENNIS, ExerciseSessionType.EXERCISE_SESSION_TYPE_TENNIS, ExerciseSessionType.EXERCISE_SESSION_TYPE_VOLLEYBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_WALKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_WATER_POLO, ExerciseSessionType.EXERCISE_SESSION_TYPE_WEIGHTLIFTING, ExerciseSessionType.EXERCISE_SESSION_TYPE_WHEELCHAIR, ExerciseSessionType.EXERCISE_SESSION_TYPE_OTHER_WORKOUT, or ExerciseSessionType.EXERCISE_SESSION_TYPE_YOGA

startTime Instant: Expected start time of this planned session. This value cannot be null.

endTime Instant: Expected end time of this planned session. This value cannot be null.

Builder

public Builder (Metadata metadata, 
                int exerciseType, 
                LocalDate startDate, 
                Duration duration)

Parameters
metadata Metadata: Metadata to be associated with the record. See Metadata. This value cannot be null.

exerciseType int: Type of exercise (e.g. walking, swimming). Required field. Allowed values: ExerciseSessionType. Value is ExerciseSessionType.EXERCISE_SESSION_TYPE_UNKNOWN, ExerciseSessionType.EXERCISE_SESSION_TYPE_BADMINTON, ExerciseSessionType.EXERCISE_SESSION_TYPE_BASEBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_BASKETBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_BIKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_BIKING_STATIONARY, ExerciseSessionType.EXERCISE_SESSION_TYPE_BOOT_CAMP, ExerciseSessionType.EXERCISE_SESSION_TYPE_BOXING, ExerciseSessionType.EXERCISE_SESSION_TYPE_CALISTHENICS, ExerciseSessionType.EXERCISE_SESSION_TYPE_CRICKET, ExerciseSessionType.EXERCISE_SESSION_TYPE_DANCING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ELLIPTICAL, ExerciseSessionType.EXERCISE_SESSION_TYPE_EXERCISE_CLASS, ExerciseSessionType.EXERCISE_SESSION_TYPE_FENCING, ExerciseSessionType.EXERCISE_SESSION_TYPE_FOOTBALL_AMERICAN, ExerciseSessionType.EXERCISE_SESSION_TYPE_FOOTBALL_AUSTRALIAN, ExerciseSessionType.EXERCISE_SESSION_TYPE_FRISBEE_DISC, ExerciseSessionType.EXERCISE_SESSION_TYPE_GOLF, ExerciseSessionType.EXERCISE_SESSION_TYPE_GUIDED_BREATHING, ExerciseSessionType.EXERCISE_SESSION_TYPE_GYMNASTICS, ExerciseSessionType.EXERCISE_SESSION_TYPE_HANDBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING, ExerciseSessionType.EXERCISE_SESSION_TYPE_HIKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ICE_HOCKEY, ExerciseSessionType.EXERCISE_SESSION_TYPE_ICE_SKATING, ExerciseSessionType.EXERCISE_SESSION_TYPE_MARTIAL_ARTS, ExerciseSessionType.EXERCISE_SESSION_TYPE_PADDLING, ExerciseSessionType.EXERCISE_SESSION_TYPE_PARAGLIDING, ExerciseSessionType.EXERCISE_SESSION_TYPE_PILATES, ExerciseSessionType.EXERCISE_SESSION_TYPE_RACQUETBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROCK_CLIMBING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROLLER_HOCKEY, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROWING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROWING_MACHINE, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUGBY, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUNNING, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUNNING_TREADMILL, ExerciseSessionType.EXERCISE_SESSION_TYPE_SAILING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SCUBA_DIVING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SKATING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SKIING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SNOWBOARDING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SNOWSHOEING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SOCCER, ExerciseSessionType.EXERCISE_SESSION_TYPE_SOFTBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_SQUASH, ExerciseSessionType.EXERCISE_SESSION_TYPE_STAIR_CLIMBING, ExerciseSessionType.EXERCISE_SESSION_TYPE_STAIR_CLIMBING_MACHINE, ExerciseSessionType.EXERCISE_SESSION_TYPE_STRENGTH_TRAINING, ExerciseSessionType.EXERCISE_SESSION_TYPE_STRETCHING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SURFING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SWIMMING_OPEN_WATER, ExerciseSessionType.EXERCISE_SESSION_TYPE_SWIMMING_POOL, ExerciseSessionType.EXERCISE_SESSION_TYPE_TABLE_TENNIS, ExerciseSessionType.EXERCISE_SESSION_TYPE_TENNIS, ExerciseSessionType.EXERCISE_SESSION_TYPE_VOLLEYBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_WALKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_WATER_POLO, ExerciseSessionType.EXERCISE_SESSION_TYPE_WEIGHTLIFTING, ExerciseSessionType.EXERCISE_SESSION_TYPE_WHEELCHAIR, ExerciseSessionType.EXERCISE_SESSION_TYPE_OTHER_WORKOUT, or ExerciseSessionType.EXERCISE_SESSION_TYPE_YOGA

startDate LocalDate: The start date of this planned session. The underlying time of the session will be set to noon of the specified day. The end time will be determined by adding the duration to this. This value cannot be null.

duration Duration: The expected duration of the planned session. This value cannot be null.

Public methods

addBlock

public PlannedExerciseSessionRecord.Builder addBlock (PlannedExerciseBlock block)

Adds a block to this planned session..

Parameters
block PlannedExerciseBlock: An PlannedExerciseBlock to add to this planned session.. This value cannot be null.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

clearBlocks

public PlannedExerciseSessionRecord.Builder clearBlocks ()

Clears the blocks of this planned session.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

clearEndZoneOffset

public PlannedExerciseSessionRecord.Builder clearEndZoneOffset ()

Sets the start zone offset of this record to system default.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

clearStartZoneOffset

public PlannedExerciseSessionRecord.Builder clearStartZoneOffset ()

Sets the start zone offset of this record to system default.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

setBlocks

public PlannedExerciseSessionRecord.Builder setBlocks (List<PlannedExerciseBlock> blocks)

Sets the blocks of this planned session.

Parameters
blocks List: A list of PlannedExerciseBlock to set for this planned session. This value cannot be null.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

setEndTime

public PlannedExerciseSessionRecord.Builder setEndTime (Instant endTime)

Sets the planned end time of the session.

Parameters
endTime Instant: This value cannot be null.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

setEndZoneOffset

public PlannedExerciseSessionRecord.Builder setEndZoneOffset (ZoneOffset endZoneOffset)

Sets the zone offset of when the workout should end.

Parameters
endZoneOffset ZoneOffset: This value cannot be null.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

setExerciseType

public PlannedExerciseSessionRecord.Builder setExerciseType (int exerciseType)

Sets the exercise type.

Parameters
exerciseType int: Value is ExerciseSessionType.EXERCISE_SESSION_TYPE_UNKNOWN, ExerciseSessionType.EXERCISE_SESSION_TYPE_BADMINTON, ExerciseSessionType.EXERCISE_SESSION_TYPE_BASEBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_BASKETBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_BIKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_BIKING_STATIONARY, ExerciseSessionType.EXERCISE_SESSION_TYPE_BOOT_CAMP, ExerciseSessionType.EXERCISE_SESSION_TYPE_BOXING, ExerciseSessionType.EXERCISE_SESSION_TYPE_CALISTHENICS, ExerciseSessionType.EXERCISE_SESSION_TYPE_CRICKET, ExerciseSessionType.EXERCISE_SESSION_TYPE_DANCING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ELLIPTICAL, ExerciseSessionType.EXERCISE_SESSION_TYPE_EXERCISE_CLASS, ExerciseSessionType.EXERCISE_SESSION_TYPE_FENCING, ExerciseSessionType.EXERCISE_SESSION_TYPE_FOOTBALL_AMERICAN, ExerciseSessionType.EXERCISE_SESSION_TYPE_FOOTBALL_AUSTRALIAN, ExerciseSessionType.EXERCISE_SESSION_TYPE_FRISBEE_DISC, ExerciseSessionType.EXERCISE_SESSION_TYPE_GOLF, ExerciseSessionType.EXERCISE_SESSION_TYPE_GUIDED_BREATHING, ExerciseSessionType.EXERCISE_SESSION_TYPE_GYMNASTICS, ExerciseSessionType.EXERCISE_SESSION_TYPE_HANDBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING, ExerciseSessionType.EXERCISE_SESSION_TYPE_HIKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ICE_HOCKEY, ExerciseSessionType.EXERCISE_SESSION_TYPE_ICE_SKATING, ExerciseSessionType.EXERCISE_SESSION_TYPE_MARTIAL_ARTS, ExerciseSessionType.EXERCISE_SESSION_TYPE_PADDLING, ExerciseSessionType.EXERCISE_SESSION_TYPE_PARAGLIDING, ExerciseSessionType.EXERCISE_SESSION_TYPE_PILATES, ExerciseSessionType.EXERCISE_SESSION_TYPE_RACQUETBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROCK_CLIMBING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROLLER_HOCKEY, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROWING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROWING_MACHINE, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUGBY, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUNNING, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUNNING_TREADMILL, ExerciseSessionType.EXERCISE_SESSION_TYPE_SAILING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SCUBA_DIVING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SKATING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SKIING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SNOWBOARDING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SNOWSHOEING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SOCCER, ExerciseSessionType.EXERCISE_SESSION_TYPE_SOFTBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_SQUASH, ExerciseSessionType.EXERCISE_SESSION_TYPE_STAIR_CLIMBING, ExerciseSessionType.EXERCISE_SESSION_TYPE_STAIR_CLIMBING_MACHINE, ExerciseSessionType.EXERCISE_SESSION_TYPE_STRENGTH_TRAINING, ExerciseSessionType.EXERCISE_SESSION_TYPE_STRETCHING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SURFING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SWIMMING_OPEN_WATER, ExerciseSessionType.EXERCISE_SESSION_TYPE_SWIMMING_POOL, ExerciseSessionType.EXERCISE_SESSION_TYPE_TABLE_TENNIS, ExerciseSessionType.EXERCISE_SESSION_TYPE_TENNIS, ExerciseSessionType.EXERCISE_SESSION_TYPE_VOLLEYBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_WALKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_WATER_POLO, ExerciseSessionType.EXERCISE_SESSION_TYPE_WEIGHTLIFTING, ExerciseSessionType.EXERCISE_SESSION_TYPE_WHEELCHAIR, ExerciseSessionType.EXERCISE_SESSION_TYPE_OTHER_WORKOUT, or ExerciseSessionType.EXERCISE_SESSION_TYPE_YOGA

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

setMetadata

public PlannedExerciseSessionRecord.Builder setMetadata (Metadata metadata)

Set the metadata for the record.

Parameters
metadata Metadata: This value cannot be null.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

setNotes

public PlannedExerciseSessionRecord.Builder setNotes (CharSequence notes)

Sets notes for this activity.

Parameters
notes CharSequence: Notes for this activity. This value may be null.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

setStartTime

public PlannedExerciseSessionRecord.Builder setStartTime (Instant startTime)

Sets the planned start time of the session.

Parameters
startTime Instant: This value cannot be null.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

setStartZoneOffset

public PlannedExerciseSessionRecord.Builder setStartZoneOffset (ZoneOffset startZoneOffset)

Sets the zone offset of when the workout should start.

Parameters
startZoneOffset ZoneOffset: This value cannot be null.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.

setTitle

public PlannedExerciseSessionRecord.Builder setTitle (CharSequence title)

Sets a title of this planned session.

Parameters
title CharSequence: Title of this activity. This value may be null.

Returns
PlannedExerciseSessionRecord.Builder This value cannot be null.