HealthDataResolver.ReadRequest.Builder
overviewpackageclasstreedeprecatedindex com samsung android sdk healthdata class healthdataresolver readrequest builder java lang object com samsung android sdk healthdata healthdataresolver readrequest builder enclosing interface healthdataresolver readrequest public static class healthdataresolver readrequest builder extends object this class is a builder to configure healthdataresolver readrequest private healthdataresolver readrequest buildreadrequest long starttime, long endtime { healthdataresolver filter filter = healthdataresolver filter greaterthan healthconstants nutrition calorie, 200 ; healthdataresolver readrequest request = new healthdataresolver readrequest builder setdatatype healthconstants nutrition health_data_type setlocaltimerange healthconstants nutrition start_time, healthconstants nutrition time_offset, starttime, endtime setfilter filter build ; return request; } since 1 0 0 constructor summary constructors constructor and description builder helps to construct a healthdataresolver readrequest object method summary all methods instance methods concrete methods modifier and type method and description healthdataresolver readrequest build builds a new healthdataresolver readrequest object healthdataresolver readrequest builder setdatatype string type sets a health data type for the request to read healthdataresolver readrequest builder setfilter healthdataresolver filter filter sets a filter for the request to read healthdataresolver readrequest 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 readrequest builder setpackagename string packagename sets the package name that provides health data to read healthdataresolver readrequest builder setproperties string[] properties sets a property array for the health data result to read healthdataresolver readrequest builder setpropertyalias string property, string alias sets an alias for the given property healthdataresolver readrequest builder setresultcount int offset, int count sets the count range of result data with a given offset and count healthdataresolver readrequest builder setsort string property, healthdataresolver sortorder sortorder sets the sort order for a given property or alias healthdataresolver readrequest builder setsourcedevices list<string> uuidlist sets a uuid list for source devices to read health data healthdataresolver readrequest builder settimeafter long time sets the time range to retrieve result data which is inserted or updated to the health data store after the given time constructor detail builder public builder helps to construct a healthdataresolver readrequest object since 1 0 0 method detail setdatatype public healthdataresolver readrequest builder setdatatype string type sets a health data type for the request to read it has to be specified before calling build parameters type - health_data_type of the data type returns the object that applies the health data type since 1 0 0 setfilter public healthdataresolver readrequest builder setfilter healthdataresolver filter filter sets a filter for the request to read parameters filter - the filter object returns the object that applies the filter since 1 0 0 setsourcedevices public healthdataresolver readrequest builder setsourcedevices list<string> uuidlist sets a uuid list for source devices to read health data parameters uuidlist - the uuid list for source devices returns the object that applies source devices since 1 0 0 setproperties public healthdataresolver readrequest builder setproperties string[] properties sets a property array for the health data result to read if it is not specified, the health data result shows all properties of the data type parameters properties - properties that want to gain in the result returns the object that applies properties since 1 0 0 setpropertyalias public healthdataresolver readrequest builder setpropertyalias string property, string alias sets an alias for the given property parameters property - the property to be shown with the alias alias - the alias for the property returns the object that applies the alias for the property since 1 0 0 setpackagename public healthdataresolver readrequest builder setpackagename string packagename sets the package name that provides health data to read accessory data's package name samsung health collects the linked accessory's data also like galaxy watch the accessory's data including galaxy watch is inserted to samsung health with the samsung health's package name, com sec android app shealth if you want to read only the specific accessory's data, make a division the device id parameters packagename - the package name that provides health data returns the object that applies the package name since 1 0 0 setsort public healthdataresolver readrequest builder setsort string property, healthdataresolver sortorder sortorder sets the sort order for a given property or alias parameters property - the property or alias to be shown with the sort order sortorder - the sort order returns the object that applies the sort order since 1 0 0 setresultcount public healthdataresolver readrequest builder setresultcount int offset, int count sets the count range of result data with a given offset and count if this method is not called, all result will be obtained from the result if you want to get only 10 data from the 3rd position in the result, set offset as 2 and count as 10 parameters offset - the start position in the whole result, which equals to or is greater than 0 count - the limited count of result, which is greater than 0 returns the object that applies the range of the result since 1 0 0 settimeafter public healthdataresolver readrequest builder settimeafter long time sets the time range to retrieve result data which is inserted or updated to the health data store after the given time it's different to set the time range based on the data's created or updated time to read data if then, use healthdataresolver filter greaterthan java lang string, t moreover it is useful to check the health data store's change after your app reads the health data store's data at the last time if the data's source device is same with the current device, time means the inserted time that data is created on the current device if the data's source device is different, time indicates the synchronized time that data on other devices is synchronized to samsung health of the current device parameters time - the time range to retrieve result data which is inserted or updated to the health data store after the specific time in milliseconds its value is started from january, 1, 1970 00 00 00 utc returns the object that applies the range of the result since 1 0 0 setlocaltimerange public healthdataresolver readrequest 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 read all data including the different time_offset is not easy use this api to build a read request as possible parameters timeproperty - the time property name that needs to add a filter offsetproperty - the time offset property begin - the beginning time of the local time range in milliseconds its minimum value is long min_value end - the end time of the local time range in milliseconds its maximum value is long max_value returns the object that applies the local time range since 1 3 0 build public healthdataresolver readrequest build builds a new healthdataresolver readrequest object check if following information is specified data type returns the healthdataresolver readrequest object throws illegalstateexception - if enough information is not specified since 1 0 0 see also setdatatype string