ExerciseUpdate

public final class ExerciseUpdate extends ProtoParcelable

Object
   ↳ ProtoParcelable
     ↳ ExerciseUpdate

Contains the latest updated state and metrics for the current exercise.

Summary

Public fields

final @NonNull Duration

Returns the total elapsed time for which the exercise has been active, i.e.

final ExerciseConfig

Returns the ExerciseConfig used by the exercise when the ExerciseUpdate was dispatched and returns null if the exercise is in prepare phase and hasn't been started yet.

final @NonNull Set<@NonNull AchievedExerciseGoal>

Returns the latest #ONE_TIME_GOALExerciseGoal s that have been achieved.

final @NonNull Map<@NonNull DataType, @NonNull AggregateDataPoint>

Returns the latest aggregated values for each metric keyed by DataType#name.

final @NonNull Map<@NonNull DataType, @NonNull List<@NonNull DataPoint>>

Returns the list of latest DataPoint for each metric keyed by data type name.

final @NonNull Set<@NonNull MilestoneMarkerSummary>

Returns the latest MilestoneMarkerSummary s.

final Instant

Returns the time at which the exercise was started or null if the exercise is in prepare phase and hasn't started yet.

final @NonNull ExerciseState

Returns the current status of the exercise.

Public constructors

ExerciseUpdate(
    ExerciseState state,
    Instant startTime,
    Duration activeDuration,
    Map<DataTypeList<DataPoint>> latestMetrics,
    Map<DataTypeAggregateDataPoint> latestAggregateMetrics,
    Set<AchievedExerciseGoal> latestAchievedGoals,
    Set<MilestoneMarkerSummary> latestMilestoneMarkerSummaries,
    ExerciseConfig exerciseConfig
)

Public methods

@NonNull String

Inherited methods

From class ProtoParcelable
int
boolean
equals(Object other)
int
void
writeToParcel(Parcel dest, int flags)

Public fields

activeDuration

public final @NonNull Duration activeDuration

Returns the total elapsed time for which the exercise has been active, i.e. started but not paused. The active duration is zero in prepare phase.

exerciseConfig

public final ExerciseConfig exerciseConfig

Returns the ExerciseConfig used by the exercise when the ExerciseUpdate was dispatched and returns null if the exercise is in prepare phase and hasn't been started yet.

latestAchievedGoals

public final @NonNull Set<@NonNull AchievedExerciseGoallatestAchievedGoals

Returns the latest #ONE_TIME_GOALExerciseGoal s that have been achieved. #MILESTONEExerciseGoal s will be returned via #getLatestMilestoneMarkerSummaries below.

latestAggregateMetrics

public final @NonNull Map<@NonNull DataType, @NonNull AggregateDataPointlatestAggregateMetrics

Returns the latest aggregated values for each metric keyed by DataType#name.

latestMetrics

public final @NonNull Map<@NonNull DataType, @NonNull List<@NonNull DataPoint>> latestMetrics

Returns the list of latest DataPoint for each metric keyed by data type name. This allows a client to easily query for the "current" values of each metric since last call.

latestMilestoneMarkerSummaries

public final @NonNull Set<@NonNull MilestoneMarkerSummarylatestMilestoneMarkerSummaries

Returns the latest MilestoneMarkerSummary s.

startTime

public final Instant startTime

Returns the time at which the exercise was started or null if the exercise is in prepare phase and hasn't started yet.

state

public final @NonNull ExerciseState state

Returns the current status of the exercise.

Public constructors