ExerciseGoal

class ExerciseGoal<T : Number> : Parcelable


Defines a goal for an exercise.

Summary

Public companion functions

ExerciseGoal<T>
<T : Number> createMilestone(
    condition: DataTypeCondition<T, AggregateDataType<T, *>>,
    period: T
)

Creates an ExerciseGoal that is achieved multiple times with its threshold being updated by a period value each time it is achieved.

ExerciseGoal<T>
<T : Number> createMilestoneGoalWithUpdatedThreshold(
    goal: ExerciseGoal<T>,
    newThreshold: T
)

Creates a new goal that is the same as a given goal but with a new threshold value.

ExerciseGoal<T>
<T : Number> createOneTimeGoal(
    condition: DataTypeCondition<T, AggregateDataType<T, *>>
)

Creates an ExerciseGoal that is achieved once when the given DataTypeCondition is satisfied.

Public companion properties

Parcelable.Creator<ExerciseGoal<*>>

Public functions

open Int
open operator Boolean
equals(other: Any?)
open Int
open String
open Unit
writeToParcel(dest: Parcel, flags: Int)

Public companion functions

createMilestone

Added in 1.0.0
fun <T : Number> createMilestone(
    condition: DataTypeCondition<T, AggregateDataType<T, *>>,
    period: T
): ExerciseGoal<T>

Creates an ExerciseGoal that is achieved multiple times with its threshold being updated by a period value each time it is achieved. For instance, a milestone could be one for every 2km. This goal will there be triggered at distances = 2km, 4km, 6km, ...

createMilestoneGoalWithUpdatedThreshold

Added in 1.0.0
fun <T : Number> createMilestoneGoalWithUpdatedThreshold(
    goal: ExerciseGoal<T>,
    newThreshold: T
): ExerciseGoal<T>

Creates a new goal that is the same as a given goal but with a new threshold value.

createOneTimeGoal

Added in 1.0.0
fun <T : Number> createOneTimeGoal(
    condition: DataTypeCondition<T, AggregateDataType<T, *>>
): ExerciseGoal<T>

Creates an ExerciseGoal that is achieved once when the given DataTypeCondition is satisfied.

Public companion properties

Public functions

describeContents

Added in 1.0.0
open fun describeContents(): Int

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

writeToParcel

Added in 1.0.0
open fun writeToParcel(dest: Parcel, flags: Int): Unit

Public properties

dataTypeCondition

Added in 1.0.0
val dataTypeConditionDataTypeCondition<T, AggregateDataType<T, *>>

exerciseGoalType

Added in 1.0.0
val exerciseGoalTypeExerciseGoalType

The type of this exercise goal (ExerciseGoalType.ONE_TIME_GOAL or ExerciseGoalType.MILESTONE.)

period

Added in 1.0.0
val period: T?