overview package class tree deprecated index com.samsung.android.sdk.healthdata class healthdataresolver.aggregaterequest.builder java.lang.object com.samsung.android.sdk.healthdata.healthdataresolver.aggregaterequest.builder enclosing interface: healthdataresolver.aggregaterequest public static class healthdataresolver.aggregaterequest.builder extends object this class creates an healthdataresolver.aggregaterequest's instance for the specified data type. since: 1.0.0 constructor summary constructors constructor and description builder() helps to construct a healthdataresolver.aggregaterequest object. method summary all methods instance methods concrete methods modifier and type method and description healthdataresolver.aggregaterequest.builder addfunction(healthdataresolver.aggregaterequest.aggregatefunction aggregate, string property, string alias) adds a required aggregation function. healthdataresolver.aggregaterequest.builder addgroup(string property, string alias) adds a group with a property name for the aggregate request. healthdataresolver.aggregaterequest build() builds a new healthdataresolver.aggregaterequest object. healthdataresolver.aggregaterequest.builder setdatatype(string type) sets a health data type for the aggregate request. healthdataresolver.aggregaterequest.builder setfilter(healthdataresolver.filter filter) sets a filter for the aggregate request. healthdataresolver.aggregaterequest.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 different time_offset in the saved health data. healthdataresolver.aggregaterequest.builder setpackagename(string packagename) sets the package name that provides health data for the aggregate request. healthdataresolver.aggregaterequest.builder setsort(string property, healthdataresolver.sortorder sortorder) sets the sort order for a given property name or alias. healthdataresolver.aggregaterequest.builder setsourcedevices(list<string> uuidlist) sets a uuid list for source devices for the aggregate request. healthdataresolver.aggregaterequest.builder settimegroup(healthdataresolver.aggregaterequest.timegroupunit unit, int amount, string timeproperty, string alias) sets a group with healthdataresolver.aggregaterequest.timegroupunit for the aggregate request. healthdataresolver.aggregaterequest.builder settimegroup(healthdataresolver.aggregaterequest.timegroupunit unit, int amount, string timeproperty, string offsetproperty, string alias) sets a group with healthdataresolver.aggregaterequest.timegroupunit and the time offset for the aggregate request. constructor detail builder public builder() helps to construct a healthdataresolver.aggregaterequest object. since: 1.0.0 method detail setdatatype public healthdataresolver.aggregaterequest.builder setdatatype(string type) sets a health data type for the aggregate request. it has to be specified before calling build(). parameters: type - health_data_type of data type returns: the object that applies the data type since: 1.0.0 setfilter public healthdataresolver.aggregaterequest.builder setfilter(healthdataresolver.filter filter) sets a filter for the aggregate request. parameters: filter - the filter object returns: the object that applies the filter since: 1.0.0 setpackagename public healthdataresolver.aggregaterequest.builder setpackagename(string packagename) sets the package name that provides health data for the aggregate request. parameters: packagename - the package name returns: the object that applies the package name since: 1.0.0 setsourcedevices public healthdataresolver.aggregaterequest.builder setsourcedevices(list<string> uuidlist) sets a uuid list for source devices for the aggregate request. parameters: uuidlist - the uuid list for source devices returns: the object that applies source devices since: 1.0.0 settimegroup public healthdataresolver.aggregaterequest.builder settimegroup(healthdataresolver.aggregaterequest.timegroupunit unit, int amount, string timeproperty, string alias) sets a group with healthdataresolver.aggregaterequest.timegroupunit for the aggregate request. it makes its result contain grouped values by the specified time unit. refer to the related example. parameters: unit - the time group unit amount - the amount for grouping by the time group unit. if you set a healthdataresolver.aggregaterequest.builder object with following configuration, time group unit: healthdataresolver.aggregaterequest.timegroupunit.hourly amount: 8 time range: 00:00 ~ 09:00 of today the aggregate result contains 2 values that are grouped by 8 hours. the first result value is for 00:00 ~ 08:00 and the second one is for 08:00 - 09:00. the amount value for each time group unit is defined in advance. be mindful to use only the values below. healthdataresolver.aggregaterequest.timegroupunit.minutely - 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60 healthdataresolver.aggregaterequest.timegroupunit.hourly - 1, 2, 3, 4, 6, 8, 12, 24 healthdataresolver.aggregaterequest.timegroupunit.daily - 1 healthdataresolver.aggregaterequest.timegroupunit.weekly - 1 healthdataresolver.aggregaterequest.timegroupunit.monthly - 1, 3, 6 timeproperty - the time property name that its values are grouped in the result alias - the alias for the time property to check the result returns: the object that applies the time group since: 1.0.0 settimegroup public healthdataresolver.aggregaterequest.builder settimegroup(healthdataresolver.aggregaterequest.timegroupunit unit, int amount, string timeproperty, string offsetproperty, string alias) sets a group with healthdataresolver.aggregaterequest.timegroupunit and the time offset for the aggregate request. it makes its result contain grouped values by the specified time unit. refer to the related example. parameters: unit - the time group unit amount - the amount for grouping by the time group unit. if you set a healthdataresolver.aggregaterequest.builder object with following configuration, time group unit: healthdataresolver.aggregaterequest.timegroupunit.hourly amount: 8 time range: 00:00 ~ 09:00 of today the aggregate result contains 2 values that are grouped by 8 hours. the first result value is for 00:00 ~ 08:00 and the second one is for 08:00 - 09:00. the amount value for each time group unit is defined in advance. be mindful to use only the values below. healthdataresolver.aggregaterequest.timegroupunit.minutely - 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60 healthdataresolver.aggregaterequest.timegroupunit.hourly - 1, 2, 3, 4, 6, 8, 12, 24 healthdataresolver.aggregaterequest.timegroupunit.daily - 1 healthdataresolver.aggregaterequest.timegroupunit.weekly - 1 healthdataresolver.aggregaterequest.timegroupunit.monthly - 1, 3, 6 timeproperty - the time property name that its values are grouped in the result offsetproperty - the time offset property which represents the time offset for the target time property alias - the alias for the time property to check the result returns: the object that applies the time group since: 1.0.0 addgroup public healthdataresolver.aggregaterequest.builder addgroup(string property, string alias) adds a group with a property name for the aggregate request. parameters: property - the property to get grouped values in the aggregate result alias - the alias for the property to check the result returns: the object that applies the property name since: 1.0.0 addfunction public healthdataresolver.aggregaterequest.builder addfunction(healthdataresolver.aggregaterequest.aggregatefunction aggregate, string property, string alias) adds a required aggregation function. it has to be specified before calling build(). parameters: aggregate - the aggregate function property - the property name for the aggregate function. in case of count, "*" is allowed. alias - the alias for the property to check the result returns: the object that applies the aggregation function since: 1.0.0 setsort public healthdataresolver.aggregaterequest.builder setsort(string property, healthdataresolver.sortorder sortorder) sets the sort order for a given property name or alias. parameters: property - the property name or alias to be sorted. if it's null, the result is not ordered. sortorder - the sort order. if it's null, the result is ordered with the default sort order. returns: the object that applies the sort order since: 1.0.0 setlocaltimerange public healthdataresolver.aggregaterequest.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 different time_offset in the saved health data. the data that has a different time_offset with other data's time_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 different time_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 filter offsetproperty - the time offset property begin - the beginning time with gmt+0 milliseconds. e.g. if you would like to get data from 00:00:00 on october 26th, 2021 in your region, set the value with 1635206400000. see sample codes. its minimum value is long.min_value. end - the end time with gmt+0 milliseconds. e.g. if you would like to get data until 00:00:00 on october 26th, 2021 in your region, set the value with 1635206400000. see sample codes. its maximum value is long.max_value. returns: the object that applies the local time range since: 1.3.0 build public healthdataresolver.aggregaterequest build() builds a new healthdataresolver.aggregaterequest object. check if following information is specified. data type aggregate function returns: the healthdataresolver.aggregaterequest object throws: illegalstateexception - if enough information is not specified since: 1.0.0 see also: setdatatype(string), addfunction(healthdataresolver.aggregaterequest.aggregatefunction, string, string)