public class WorkoutListTemplate extends Object
Modifier and Type | Class and Description |
---|---|
static class |
WorkoutListTemplate.HrZoneTemplate |
static class |
WorkoutListTemplate.StepTemplate
Represents the definition of a step in a workout
|
static class |
WorkoutListTemplate.WorkoutTemplate
Represents the definition of a single workout
|
Constructor and Description |
---|
WorkoutListTemplate()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static WorkoutListTemplate |
fromJson(String json)
Creates a new, fully populated list definition from JSON by deserializing
the JSON to a new instance.
|
static WorkoutListTemplate |
fromWorkoutList(WorkoutList list)
Build an WorkoutListTemplate instance from a WorkoutList instance
|
LinkedHashMap<String,WorkoutListTemplate.HrZoneTemplate> |
getHrZones()
Return the list with HR zone settings
|
List<WorkoutListTemplate.WorkoutTemplate> |
getWorkouts()
Return the list of workouts
|
void |
setHrZonesFromSettings(WatchSettings settings)
Overwrite the default HR Zones with the values from the WatchSettings
|
void |
setHrZonesToSettings(WatchSettings settings)
Set the HR Zones in this template to the WatchSettings
|
String |
toJson()
Serializes the list of workouts defintion to a UTF-8 JSON string
|
WorkoutList |
toWorkoutList()
This method creates a fully populated WorkoutList instance containing
the information required to write to the workout files 0x00BEnnnn
|
String |
validate()
This method performs consistency checks on the content in this template
|
public WorkoutListTemplate()
public List<WorkoutListTemplate.WorkoutTemplate> getWorkouts()
public LinkedHashMap<String,WorkoutListTemplate.HrZoneTemplate> getHrZones()
public String toJson()
public static WorkoutListTemplate fromJson(String json)
json
- The definition in JSON format.public static WorkoutListTemplate fromWorkoutList(WorkoutList list)
list
- The workout listpublic WorkoutList toWorkoutList()
public void setHrZonesFromSettings(WatchSettings settings)
settings
- The WatchSettingspublic void setHrZonesToSettings(WatchSettings settings)
settings
- The WatchSettingspublic String validate()
Copyright © 2023. All rights reserved.