Added in API level 34

BloodGlucose


public final class BloodGlucose
extends Object implements Comparable<BloodGlucose>

java.lang.Object
   ↳ android.health.connect.datatypes.units.BloodGlucose


Represents a unit of blood glucose level (glycaemia). Supported units: mmol/L

Summary

Public methods

int compareTo(BloodGlucose other)

Compares this object with the specified object for order.

boolean equals(Object object)

Indicates whether some other object is "equal to" this one.

static BloodGlucose fromMillimolesPerLiter(double value)

Creates a BloodGlucose object with the specified value in mmol/L

double getInMillimolesPerLiter()

Returns blood glucose in millimoles per liter

int hashCode()

Returns a hash code value for the object.

String toString()

Returns a string representation of the object.

Inherited methods

Public methods

compareTo

Added in API level 34
public int compareTo (BloodGlucose other)

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Parameters
other BloodGlucose: the object to be compared. This value cannot be null.

Returns
int a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Throws
NullPointerException if the specified object is null
ClassCastException if the specified object's type prevents it from being compared to this object.

equals

Added in API level 34
public boolean equals (Object object)

Indicates whether some other object is "equal to" this one.

Parameters
object Object: the reference object with which to compare.

Returns
boolean true if this object is the same as the object argument; false otherwise.

fromMillimolesPerLiter

Added in API level 34
public static BloodGlucose fromMillimolesPerLiter (double value)

Creates a BloodGlucose object with the specified value in mmol/L

Parameters
value double: value to be set as millimoles per liter

Returns
BloodGlucose This value cannot be null.

getInMillimolesPerLiter

Added in API level 34
public double getInMillimolesPerLiter ()

Returns blood glucose in millimoles per liter

Returns
double

hashCode

Added in API level 34
public int hashCode ()

Returns a hash code value for the object.

Returns
int a hash code value for this object.

toString

Added in API level 34
public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.