# SampleDataPoint

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/data/SampleDataPoint.kt+class:androidx.health.services.client.data.SampleDataPoint) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

*** ** * ** ***


```
class SampleDataPoint<T : Any> : DataPoint<T>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.health.services.client.data.DataPoint](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint)\<T\> ||
|   | ↳ | [androidx.health.services.client.data.SampleDataPoint](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint) |

*** ** * ** ***

Data point that represents a piece of data that was valid at a single point in time, for example heart rate or speed.

## Summary

| ### Public constructors |
|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint#SampleDataPoint(androidx.health.services.client.data.DataType,kotlin.Any,java.time.Duration,android.os.Bundle,androidx.health.services.client.data.DataPointAccuracy)( dataType: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType<T, https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint<T>>, value: T, timeDurationFromBoot: https://developer.android.com/reference/java/time/Duration.html, metadata: https://developer.android.com/reference/android/os/Bundle.html, accuracy: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointAccuracy? )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint#getTimeInstant(java.time.Instant)(bootInstant: https://developer.android.com/reference/java/time/Instant.html)` Returns the time `https://developer.android.com/reference/java/time/Instant.html` of this `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint`, knowing the time at which the system booted. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint#hashCode()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPointAccuracy?` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint#accuracy()` Accuracy of this DataPoint. |
| `open https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType<T, https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint<T>>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint#dataType()` The `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType` this `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint` represents. |
| `https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint#metadata()` OEM specific data. |
| `https://developer.android.com/reference/java/time/Duration.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint#timeDurationFromBoot()` The time this `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint` represents. |
| `T` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/SampleDataPoint#value()` The value of this data point. |

## Public constructors

### SampleDataPoint

```
<T : Any> SampleDataPoint(
    dataType: DataType<T, SampleDataPoint<T>>,
    value: T,
    timeDurationFromBoot: Duration,
    metadata: Bundle = Bundle(),
    accuracy: DataPointAccuracy? = null
)
```

## Public functions

### equals

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

### getTimeInstant

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
fun getTimeInstant(bootInstant: Instant): Instant
```

Returns the time `https://developer.android.com/reference/java/time/Instant.html` of this `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint`, knowing the time at which the system booted.

| Parameters |
|---|---|
| `bootInstant: https://developer.android.com/reference/java/time/Instant.html` | the `https://developer.android.com/reference/java/time/Instant.html` at which the system booted, this can be computed by `Instant.ofEpochMilli(System.currentTimeMillis() - SystemClock.elapsedRealtime()) ` |

### hashCode

```
open fun hashCode(): Int
```

## Public properties

### accuracy

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val accuracy: DataPointAccuracy?
```

Accuracy of this DataPoint.

### dataType

```
open val dataType: DataType<T, SampleDataPoint<T>>
```

The `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType` this `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint` represents.

### metadata

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val metadata: Bundle
```

OEM specific data. In general, this should not be relied upon by non-preloaded apps.

### timeDurationFromBoot

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val timeDurationFromBoot: Duration
```

The time this `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataPoint` represents.

### value

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val value: T
```

The value of this data point.