# PlannedExerciseSessionRecord

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

*** ** * ** ***


```
public final class PlannedExerciseSessionRecord implements Record
```

<br />

*** ** * ** ***

Captures a planned exercise session, also commonly referred to as a training plan.

Each record contains a start time, end time, an exercise type and a list of
\[PlannedExerciseBlock\] which describe the details of the planned session. The start and end times
may be in the future.

Requires `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectFeatures#FEATURE_PLANNED_EXERCISE()`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#PlannedExerciseSessionRecord(androidx.health.connect.client.records.metadata.Metadata,java.time.LocalDate,java.time.Duration,kotlin.collections.List,kotlin.Int,kotlin.String,kotlin.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata metadata, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/LocalDate.html startDate, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html duration, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseBlock> blocks, int exerciseType, https://developer.android.com/reference/java/lang/String.html title, https://developer.android.com/reference/java/lang/String.html notes )` Constructor that accepts a local date plus a duration. |
| `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#PlannedExerciseSessionRecord(java.time.Instant,java.time.ZoneOffset,java.time.Instant,java.time.ZoneOffset,androidx.health.connect.client.records.metadata.Metadata,kotlin.collections.List,kotlin.Int,kotlin.String,kotlin.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html startTime, https://developer.android.com/reference/java/time/ZoneOffset.html startZoneOffset, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html endTime, https://developer.android.com/reference/java/time/ZoneOffset.html endZoneOffset, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata metadata, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseBlock> blocks, int exerciseType, https://developer.android.com/reference/java/lang/String.html title, https://developer.android.com/reference/java/lang/String.html notes )` Constructor that accepts a physical time and zone offset. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseBlock>` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#getBlocks()()` |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#getCompletedExerciseSessionId()()` The exercise session that completed this planned session. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#getEndTime()()` End time of the record. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#getEndZoneOffset()()` User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/IntervalRecord#endTime()`, or null if unknown. |
| `final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#getExerciseType()()` Type of exercise (e.g. walking, swimming). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#getMetadata()()` Set of common metadata associated with the written record. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#getNotes()()` Additional notes for the session. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#getStartTime()()` Start time of the record. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#getStartZoneOffset()()` User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/IntervalRecord#startTime()`, or null if unknown. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#getTitle()()` Title of the session. |
| `final boolean` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#hasExplicitTime()()` |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#toString()()` |

## Public constructors

### PlannedExerciseSessionRecord

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

```
public PlannedExerciseSessionRecord(
    @NonNull Metadata metadata,
    @NonNull LocalDate startDate,
    @NonNull Duration duration,
    @NonNull List<@NonNull PlannedExerciseBlock> blocks,
    int exerciseType,
    String title,
    String notes
)
```

Constructor that accepts a local date plus a duration. The start time will be implicitly generated from a local time at noon in the system default timezone on the day specified by `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#(androidx.health.connect.client.records.metadata.Metadata,java.time.LocalDate,java.time.Duration,kotlin.collections.List,kotlin.Int,kotlin.String,kotlin.String)`. The end time will be generated by adding `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseSessionRecord#(androidx.health.connect.client.records.metadata.Metadata,java.time.LocalDate,java.time.Duration,kotlin.collections.List,kotlin.Int,kotlin.String,kotlin.String)` to the start time.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata metadata` | Metadata for this session. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/LocalDate.html startDate` | The date on which the session should occur. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html duration` | The expected or estimated duration of the session. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseBlock> blocks` | The `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseBlock`s that contain details of this session. |
| `int exerciseType` | The exercise type of this session. |
| `https://developer.android.com/reference/java/lang/String.html title` | The title of this session. |
| `https://developer.android.com/reference/java/lang/String.html notes` | Notes for this session. |

### PlannedExerciseSessionRecord

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

```
public PlannedExerciseSessionRecord(
    @NonNull Instant startTime,
    ZoneOffset startZoneOffset,
    @NonNull Instant endTime,
    ZoneOffset endZoneOffset,
    @NonNull Metadata metadata,
    @NonNull List<@NonNull PlannedExerciseBlock> blocks,
    int exerciseType,
    String title,
    String notes
)
```

Constructor that accepts a physical time and zone offset.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html startTime` | The time at which the session should start. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html startZoneOffset` | The zone offset at the start of this session. If null is provided, this will default to the current system timezone. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html endTime` | The time at which the session should end. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html endZoneOffset` | The zone offset at the end of this session. If null is provided, this will default to the current system timezone. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata metadata` | Metadata for this session. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseBlock> blocks` | The `https://developer.android.com/reference/androidx/health/connect/client/records/PlannedExerciseBlock`s that contain details of this session. |
| `int exerciseType` | The exercise type of this session. |
| `https://developer.android.com/reference/java/lang/String.html title` | The title of this session. |
| `https://developer.android.com/reference/java/lang/String.html notes` | Notes for this session. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getBlocks

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

```
public final @NonNull List<@NonNull PlannedExerciseBlock> getBlocks()
```

### getCompletedExerciseSessionId

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

```
public final String getCompletedExerciseSessionId()
```

The exercise session that completed this planned session.

### getEndTime

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

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

End time of the record.

### getEndZoneOffset

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

```
public ZoneOffset getEndZoneOffset()
```

User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/IntervalRecord#endTime()`, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent.

### getExerciseType

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

```
public final int getExerciseType()
```

Type of exercise (e.g. walking, swimming). Required field.

### getMetadata

```
public @NonNull Metadata getMetadata()
```

Set of common metadata associated with the written record.

### getNotes

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

```
public final String getNotes()
```

Additional notes for the session. Optional field.

### getStartTime

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

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

Start time of the record.

### getStartZoneOffset

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

```
public ZoneOffset getStartZoneOffset()
```

User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/IntervalRecord#startTime()`, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent.

### getTitle

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

```
public final String getTitle()
```

Title of the session. Optional field.

### hasExplicitTime

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

```
public final boolean hasExplicitTime()
```

### hashCode

```
public int hashCode()
```

### toString

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