PassiveGoal

public final class PassiveGoal extends ProtoParcelable

Object
   ↳ ProtoParcelable
     ↳ PassiveGoal

Defines an passive goal that will be triggered when the specified condition is met.

Summary

Nested types

PassiveGoal.Companion
PassiveGoal.TriggerType

Whether or not repeated passive goals should be triggered.

PassiveGoal.TriggerType.Companion

Public fields

final @NonNull DataTypeCondition

DataTypeCondition which must be met for the passive goal to be triggered.

final @NonNull PassiveGoal.TriggerType

Public constructors

PassiveGoal(
    DataTypeCondition dataTypeCondition,
    PassiveGoal.TriggerType triggerType
)

Public methods

final boolean

Does the provided DataPoint satisfy the passive goal condition.

final void

Puts the goal as an extra into a given Intent.

@NonNull String

Inherited methods

From class ProtoParcelable
int
boolean
equals(Object other)
int
void
writeToParcel(Parcel dest, int flags)

Public fields

dataTypeCondition

public final @NonNull DataTypeCondition dataTypeCondition

DataTypeCondition which must be met for the passive goal to be triggered.

triggerType

public final @NonNull PassiveGoal.TriggerType triggerType

Public constructors

PassiveGoal

public final PassiveGoal(
    DataTypeCondition dataTypeCondition,
    PassiveGoal.TriggerType triggerType
)

Public methods

isTriggered

public final boolean isTriggered(DataPoint dataPoint)

Does the provided DataPoint satisfy the passive goal condition.

Throws
kotlin.IllegalArgumentException

if the provided data point is not of the same data type as the condition itself.

putToIntent

public final void putToIntent(Intent intent)

Puts the goal as an extra into a given Intent. The state can then be obtained from the intent via PassiveGoal.fromIntent.

toString

public @NonNull String toString()