com.samsung.android.sdk.healthdata
Class HealthDevice.Builder
- java.lang.Object
-
- com.samsung.android.sdk.healthdata.HealthDevice.Builder
-
- Enclosing class:
- HealthDevice
public static class HealthDevice.Builder extends Object
This class is a builder to configureHealthDevice
.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor and Description Builder()
Helps to construct theHealthDevice
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description HealthDevice
build()
Builds a newHealthDevice
object.HealthDevice.Builder
setCustomName(String name)
Sets the user-provided name the device.HealthDevice.Builder
setDeviceSeed(String seed)
Sets the seed to make a device's unique identifier.HealthDevice.Builder
setGroup(int group)
Sets the group of device.HealthDevice.Builder
setManufacturer(String manufacturer)
Sets the manufacturer name of the device.HealthDevice.Builder
setModel(String model)
Sets the model name of the device.
-
-
-
Constructor Detail
-
Builder
public Builder()
Helps to construct theHealthDevice
object.- Since:
- 1.0.0
-
-
Method Detail
-
setModel
public HealthDevice.Builder setModel(String model)
Sets the model name of the device.- Parameters:
model
- The model name- Returns:
- The object that applies the model name
- Since:
- 1.0.0
-
setManufacturer
public HealthDevice.Builder setManufacturer(String manufacturer)
Sets the manufacturer name of the device.- Parameters:
manufacturer
- The manufacturer name- Returns:
- The object that applies the manufacturer
- Since:
- 1.0.0
-
setCustomName
public HealthDevice.Builder setCustomName(String name)
Sets the user-provided name the device.- Parameters:
name
- The user-provided name- Returns:
- The object that applies the user-provided name
- Since:
- 1.0.0
-
setDeviceSeed
public HealthDevice.Builder setDeviceSeed(String seed)
Sets the seed to make a device's unique identifier. It can be a Wi-Fi Mac address, Bluetooth address, or device's serial number.- Parameters:
seed
- The seed to make the device's unique identifier- Returns:
- The object that applies the seed
- Since:
- 1.0.0
-
setGroup
public HealthDevice.Builder setGroup(int group)
Sets the group of device.- Parameters:
group
- The group identifier It can be the following value.- Returns:
- The object that applies the group
- Since:
- 1.0.0
-
build
public HealthDevice build()
Builds a newHealthDevice
object. Check seed and group information are specified properly.- Returns:
- The
HealthDevice
object. Its group is predefined as GROUP_UNKNOWN ifsetGroup(int)
is not called. - Throws:
IllegalStateException
- If the seed isnull
or device group is not set correctly- Since:
- 1.0.0
-
-