ExerciseGoal

public final class ExerciseGoal<T extends Number> implements Parcelable


Defines a goal for an exercise.

Summary

Public fields

static final @NonNull Parcelable.Creator<@NonNull ExerciseGoal<@NonNull ?>>

Public methods

static final @NonNull ExerciseGoal<@NonNull T>
<T extends Number> createMilestone(
    @NonNull DataTypeCondition<@NonNull T, @NonNull AggregateDataType<@NonNull T, @NonNull ?>> condition,
    @NonNull T period
)

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

static final @NonNull ExerciseGoal<@NonNull T>
<T extends Number> createMilestoneGoalWithUpdatedThreshold(
    @NonNull ExerciseGoal<@NonNull T> goal,
    @NonNull T newThreshold
)

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

static final @NonNull ExerciseGoal<@NonNull T>

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

int
boolean
equals(Object other)
final @NonNull DataTypeCondition<@NonNull T, @NonNull AggregateDataType<@NonNull T, @NonNull ?>>
final @NonNull ExerciseGoalType

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

final T
int
@NonNull String
void
writeToParcel(@NonNull Parcel dest, int flags)

Public fields

CREATOR

public static final @NonNull Parcelable.Creator<@NonNull ExerciseGoal<@NonNull ?>> CREATOR

Public methods

createMilestone

Added in 1.0.0
public static final @NonNull ExerciseGoal<@NonNull T> <T extends Number> createMilestone(
    @NonNull DataTypeCondition<@NonNull T, @NonNull AggregateDataType<@NonNull T, @NonNull ?>> condition,
    @NonNull T period
)

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
public static final @NonNull ExerciseGoal<@NonNull T> <T extends Number> createMilestoneGoalWithUpdatedThreshold(
    @NonNull ExerciseGoal<@NonNull T> goal,
    @NonNull T newThreshold
)

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

createOneTimeGoal

Added in 1.0.0
public static final @NonNull ExerciseGoal<@NonNull T> <T extends Number> createOneTimeGoal(
    @NonNull DataTypeCondition<@NonNull T, @NonNull AggregateDataType<@NonNull T, @NonNull ?>> condition
)

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

describeContents

Added in 1.0.0
public int describeContents()

equals

public boolean equals(Object other)

getDataTypeCondition

Added in 1.0.0
public final @NonNull DataTypeCondition<@NonNull T, @NonNull AggregateDataType<@NonNull T, @NonNull ?>> getDataTypeCondition()

getExerciseGoalType

Added in 1.0.0
public final @NonNull ExerciseGoalType getExerciseGoalType()

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

getPeriod

Added in 1.0.0
public final T getPeriod()

hashCode

public int hashCode()

toString

public @NonNull String toString()

writeToParcel

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