Page Summary
-
Goal.MetricObjective is a class that represents a metric objective for a goal, determining if the goal is met based on a metric value.
-
It supports metrics like steps, distance, and calories.
-
This class implements the Parcelable interface.
-
Key methods include
getDataTypeName()to get the type of metric andgetValue()to get the target value of the metric.
A metric objective, which uses a metric value to determine whether the goal is met. Metrics include step, distance and calories. For example, 10k steps, 3km, 2k calories.
Inherited Constant Summary
Field Summary
| public static final Creator<Goal.MetricObjective> | CREATOR |
Public Constructor Summary
|
MetricObjective(String
dataTypeName, double value, double initialValue)
|
|
|
MetricObjective(String
dataTypeName, double value)
|
Public Method Summary
| boolean | |
| String |
getDataTypeName()
Returns the data type name of the metric the goal tracks, such as
com.google.step_count.delta or
com.google.distance.delta.
|
| double |
getValue()
Returns the objective metric's value.
|
| int |
hashCode()
|
| String |
toString()
|
| void |
writeToParcel(Parcel dest, int
flags)
|
Inherited Method Summary
Fields
public static final Creator<Goal.MetricObjective> CREATOR
Public Constructors
public MetricObjective (String dataTypeName, double value, double initialValue)
public MetricObjective (String dataTypeName, double value)
Public Methods
public boolean equals (Object other)
public String getDataTypeName ()
Returns the data type name of the metric the goal tracks, such as
com.google.step_count.delta or com.google.distance.delta. For
example, returns "com.google.step_count.delta" for a goal to "take 10k steps a
day".
public double getValue ()
Returns the objective metric's value. For example, returns 10,000 for a goal to "take 10k steps a day".