# MilestoneMarkerSummary

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/data/MilestoneMarkerSummary.kt+class:androidx.health.services.client.data.MilestoneMarkerSummary) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

*** ** * ** ***


```
public final class MilestoneMarkerSummary
```

<br />

*** ** * ** ***

The summary of metrics and state from the previously achieved milestone marker `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#MilestoneMarkerSummary(java.time.Instant,java.time.Instant,java.time.Duration,androidx.health.services.client.data.ExerciseGoal,androidx.health.services.client.data.DataPointContainer)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html startTime, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html endTime, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html activeDuration, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Number.html> achievedGoal, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DataPointContainer summaryMetrics )` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Number.html>` | `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#getAchievedGoal()()` The `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal` that triggered this milestone summary. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html` | `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#getActiveDuration()()` Returns the total elapsed time for which the exercise was active during this milestone, i.e. started but not paused. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#getEndTime()()` Returns the time at which this milestone marker was reached. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#getStartTime()()` Returns the time at which this milestone marker started being tracked. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/DataPointContainer` | `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#getSummaryMetrics()()` Returns the `https://developer.android.com/reference/androidx/health/services/client/data/DataPointContainer` for aggregated metrics tracked between `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#(java.time.Instant,java.time.Instant,java.time.Duration,androidx.health.services.client.data.ExerciseGoal,androidx.health.services.client.data.DataPointContainer)` and `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#(java.time.Instant,java.time.Instant,java.time.Duration,androidx.health.services.client.data.ExerciseGoal,androidx.health.services.client.data.DataPointContainer)` i.e. during the duration of this milestone. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#toString()()` |

## Public constructors

### MilestoneMarkerSummary

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public MilestoneMarkerSummary(
    @NonNull Instant startTime,
    @NonNull Instant endTime,
    @NonNull Duration activeDuration,
    @NonNull ExerciseGoal<@NonNull Number> achievedGoal,
    @NonNull DataPointContainer summaryMetrics
)
```

## Public methods

### getAchievedGoal

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final @NonNull ExerciseGoal<@NonNull Number> getAchievedGoal()
```

The `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseGoal` that triggered this milestone summary.

### getActiveDuration

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final @NonNull Duration getActiveDuration()
```

Returns the total elapsed time for which the exercise was active during this milestone, i.e. started but not paused.

### getEndTime

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final @NonNull Instant getEndTime()
```

Returns the time at which this milestone marker was reached.

### getStartTime

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final @NonNull Instant getStartTime()
```

Returns the time at which this milestone marker started being tracked.

### getSummaryMetrics

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
public final @NonNull DataPointContainer getSummaryMetrics()
```

Returns the `https://developer.android.com/reference/androidx/health/services/client/data/DataPointContainer` for aggregated metrics tracked between `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#(java.time.Instant,java.time.Instant,java.time.Duration,androidx.health.services.client.data.ExerciseGoal,androidx.health.services.client.data.DataPointContainer)` and `https://developer.android.com/reference/androidx/health/services/client/data/MilestoneMarkerSummary#(java.time.Instant,java.time.Instant,java.time.Duration,androidx.health.services.client.data.ExerciseGoal,androidx.health.services.client.data.DataPointContainer)` i.e. during the duration of this milestone. This summary will only contain `https://developer.android.com/reference/androidx/health/services/client/data/DataPoint`s for `https://developer.android.com/reference/androidx/health/services/client/data/AggregateDataType`s.

### toString

```
public @NonNull String toString()
```