ExerciseUpdate

public data final class 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 @NonNull ExerciseConfig

Returns the ExerciseConfig used by the exercise when the ExerciseUpdate was dispatched.

final @NonNull Set<@NonNull AchievedExerciseGoal>

Returns the latest #ONE_TIME_GOALExerciseGoal s that have been achieved.

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 @NonNull Instant

Returns the time at which the exercise was started.

final @NonNull ExerciseState

Returns the current status of the exercise.

Public constructors

ExerciseUpdate(
    @NonNull ExerciseState state,
    @NonNull Instant startTime,
    @NonNull Duration activeDuration,
    @NonNull Map<@NonNull DataType, @NonNull List<@NonNull DataPoint>> latestMetrics,
    @NonNull Set<@NonNull AchievedExerciseGoal> latestAchievedGoals,
    @NonNull Set<@NonNull MilestoneMarkerSummary> latestMilestoneMarkerSummaries,
    @NonNull ExerciseConfig exerciseConfig
)

Public methods

int
void
writeToParcel(@NonNull Parcel dest, int flags)

Public fields

activeDuration

@NonNull
public final @NonNull Duration activeDuration

Returns the total elapsed time for which the exercise has been active, i.e. started but not paused.

exerciseConfig

@NonNull
public final @NonNull ExerciseConfig exerciseConfig

Returns the ExerciseConfig used by the exercise when the ExerciseUpdate was dispatched.

latestAchievedGoals

@NonNull
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.

latestMetrics

@NonNull
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. There will only be one value for an Aggregated DataType.

latestMilestoneMarkerSummaries

@NonNull
public final @NonNull Set<@NonNull MilestoneMarkerSummarylatestMilestoneMarkerSummaries

Returns the latest MilestoneMarkerSummary s.

startTime

@NonNull
public final @NonNull Instant startTime

Returns the time at which the exercise was started.

state

@NonNull
public final @NonNull ExerciseState state

Returns the current status of the exercise.

Public constructors

ExerciseUpdate

public final ExerciseUpdate(
    @NonNull ExerciseState state,
    @NonNull Instant startTime,
    @NonNull Duration activeDuration,
    @NonNull Map<@NonNull DataType, @NonNull List<@NonNull DataPoint>> latestMetrics,
    @NonNull Set<@NonNull AchievedExerciseGoal> latestAchievedGoals,
    @NonNull Set<@NonNull MilestoneMarkerSummary> latestMilestoneMarkerSummaries,
    @NonNull ExerciseConfig exerciseConfig
)

Public methods

describeContents

@NonNull
public int describeContents()

writeToParcel

@NonNull
public void writeToParcel(@NonNull Parcel dest, int flags)