Builder


class Builder
kotlin.Any
   ↳ android.health.connect.datatypes.Device.Builder

Summary

Public constructors

Public methods
Device

Build and return Device object

Device.Builder
setDisplayName(displayName: String?)

Sets an optional display name for the device

Device.Builder
setManufacturer(manufacturer: String?)

Sets an optional client supplied manufacturer of the device

Device.Builder
setModel(model: String?)

Sets an optional client supplied model of the device

Device.Builder
setType(type: Int)

Sets an optional client supplied type of the device

Device.Builder
setUdi(udi: String?)

Sets an optional client supplied UDI (Unique Device Identifier), a unique numeric or alphanumeric code assigned to a medical device, for this Device instance.

Public constructors

Builder

Builder()

Public methods

build

fun build(): Device

Build and return Device object

Return
Device This value cannot be null.

setDisplayName

fun setDisplayName(displayName: String?): Device.Builder

Sets an optional display name for the device

Parameters
displayName String?: This value may be null.
Return
Device.Builder This value cannot be null.

setManufacturer

fun setManufacturer(manufacturer: String?): Device.Builder

Sets an optional client supplied manufacturer of the device

Parameters
manufacturer String?: This value may be null.
Return
Device.Builder This value cannot be null.

setModel

fun setModel(model: String?): Device.Builder

Sets an optional client supplied model of the device

Parameters
model String?: This value may be null.
Return
Device.Builder This value cannot be null.

setUdi

Added in API level 34
fun setUdi(udi: String?): Device.Builder

Sets an optional client supplied UDI (Unique Device Identifier), a unique numeric or alphanumeric code assigned to a medical device, for this Device instance.

A device receives a UDI from an accredited issuing agency (e.g. from GS1) which is then registered in multiple regulatory databases (e.g. FDA). The UDI is a unique, globally recognized identifier assigned to a specific device model. An accredited issuing agency, like GS1, provides the global standards used to create the UDI codes. The manufacturers must submit the UDI provided by GS1 to the relevant regulatory databases for each market they operate in.

  • In the US, this is the FDA’s Global Unique Device Identification Database (GUDID).
  • In the EU, it is the European Database on Medical Devices (EUDAMED).

The calling package needs to declare HealthPermissions#WRITE_DEVICE_UDI in manifest to be able to set UDI for any record. SecurityException is thrown when upserting a record with UDI without the permission.

Parameters
udi String?: This value may be null.
Return
Device.Builder This value cannot be null.