com.samsung.android.sdk.healthdata
Class HealthDataResolver.DeleteRequest.Builder
- java.lang.Object
-
- com.samsung.android.sdk.healthdata.HealthDataResolver.DeleteRequest.Builder
-
- Enclosing interface:
- HealthDataResolver.DeleteRequest
public static class HealthDataResolver.DeleteRequest.Builder extends Object
This class is a builder to configureHealthDataResolver.DeleteRequest
. Only your app's created health data can be deleted.public class HealthDataResolverExample { private HealthDataResolver.DeleteRequest buildDeleteRequest() { HealthDataResolver.Filter filter = HealthDataResolver.Filter.lessThan(HealthConstants.Nutrition.Calories, 10); HealthDataResolver.DeleteRequest request = new HealthDataResolver.DeleteRequest.Builder() .setDataType(HealthConstants.Nutrition.HEALTH_DATA_TYPE) .setFilter(filter) .build(); return request; } }
- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor and Description Builder()
Helps to construct aHealthDataResolver.DeleteRequest
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description HealthDataResolver.DeleteRequest
build()
Builds a newHealthDataResolver.DeleteRequest
object.HealthDataResolver.DeleteRequest.Builder
setDataType(String type)
Sets a health data type to delete.HealthDataResolver.DeleteRequest.Builder
setFilter(HealthDataResolver.Filter filter)
Sets a filter for health data to be deleted.HealthDataResolver.DeleteRequest.Builder
setLocalTimeRange(String timeProperty, String offsetProperty, long begin, long end)
Sets the local time range not to miss data from the query's result when there exist data with a differentTIME_OFFSET
in the saved health data.HealthDataResolver.DeleteRequest.Builder
setSourceDevices(List<String> uuidList)
Sets a UUID list of source devices for health data to be deleted.
-
-
-
Constructor Detail
-
Builder
public Builder()
Helps to construct aHealthDataResolver.DeleteRequest
object.- Since:
- 1.0.0
-
-
Method Detail
-
setDataType
public HealthDataResolver.DeleteRequest.Builder setDataType(String type)
Sets a health data type to delete. It has to be specified before callingbuild()
.- Parameters:
type
-HEALTH_DATA_TYPE
of the data type- Returns:
- The object that applies health data to delete
- Since:
- 1.0.0
-
setFilter
public HealthDataResolver.DeleteRequest.Builder setFilter(HealthDataResolver.Filter filter)
Sets a filter for health data to be deleted. It has to be specified before callingbuild()
.- Parameters:
filter
- The filter object to delete- Returns:
- The object that applies the
filter
- Since:
- 1.0.0
-
setSourceDevices
public HealthDataResolver.DeleteRequest.Builder setSourceDevices(List<String> uuidList)
Sets a UUID list of source devices for health data to be deleted.- Parameters:
uuidList
- The UUID list for source devices- Returns:
- The object that applies source devices
- Since:
- 1.0.0
-
setLocalTimeRange
public HealthDataResolver.DeleteRequest.Builder setLocalTimeRange(String timeProperty, String offsetProperty, long begin, long end)
Sets the local time range not to miss data from the query's result when there exist data with a differentTIME_OFFSET
in the saved health data.
The data that has a different
TIME_OFFSET
with other data'sTIME_OFFSET
can be saved when the daylight time is applied or the user moves to another region by like a travel. Building a complete query to aggregate all data including the differentTIME_OFFSET
is not easy.
Use this API to build an aggregate request as possible.- Parameters:
timeProperty
- The time property name that needs to add a filteroffsetProperty
- The time offset propertybegin
- The beginning time withGMT+0
milliseconds.
E.g. If you would like to delete data from00:00:00
on October 26th, 2021 in your region, set the value with1635206400000
.
See sample codes.
Its minimum value isLong.MIN_VALUE
.end
- The end time withGMT+0
milliseconds.
E.g. If you would like to delete data until00:00:00
on October 26th, 2021 in your region, set the value with1635206400000
.
See sample codes.
Its maximum value isLong.MAX_VALUE
.- Returns:
- The object that applies the local time range
- Since:
- 1.5.0
-
build
public HealthDataResolver.DeleteRequest build()
Builds a newHealthDataResolver.DeleteRequest
object. Check if the data type is defined withsetDataType(String)
.- Returns:
- The
HealthDataResolver.DeleteRequest
object - Throws:
IllegalStateException
- If no data type is specified- Since:
- 1.0.0
- See Also:
setDataType(String)
-
-