Class HKQuantitySeriesSampleBuilder

  • All Implemented Interfaces:
    NSObject

    public class HKQuantitySeriesSampleBuilder
    extends NSObject
    HKQuantitySeriesSampleBuilder An HKQuantitySeriesSampleBuilder is used to generate HKQuantitySample(s) with multiple quantities. An HKQuantitySeriesSampleBuilder is used to incrementally create a new quantity series sample in the HealthKit database. This class may be used to create long-running quantity series samples that are associated with an activity like a workout. After inserting each of the quantities that make up the series, the series may be finalized by calling -finishSeriesWithMetadata:completion:. Calling -discard invalidates the series and discards any data that was previously associated with it.
    • Constructor Detail

      • HKQuantitySeriesSampleBuilder

        protected HKQuantitySeriesSampleBuilder​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • device

        public HKDevice device()
        [@property] device
      • discard

        public void discard()
        discard Discards all previously inserted data and invalidates the series. Calling this method will delete all quantities that were previously inserted into the series and invalidate the receiver. Calling other methods on the receiver after calling -discard will result in an exception.
      • finishSeriesWithMetadataCompletion

        public void finishSeriesWithMetadataCompletion​(NSDictionary<java.lang.String,​?> metadata,
                                                       HKQuantitySeriesSampleBuilder.Block_finishSeriesWithMetadataCompletion completion)
        finishSeriesWithMetadata:completion: Finalizes the series and returns the resulting HKQuantitySample(s). Call this method when all quantities for the series have been inserted. The completion handler will return the resulting HKQuantitySample(s) Note that it is possible for a single HKQuantitySeriesSampleBuilder to produce multiple samples. If no quantity data was added, then samples will be nil and an error will be returned. This method functions as a convenience for finishSeriesWithMetadata:endDate:completion: when endDate is nil. After calling this method, the receiver will be considered invalid and calling any other method will result in an error.
        Parameters:
        metadata - Optional metadata may be added to associate with the series. Predefined keys are found in HKMetadata.h, or custom NSString keys used by the client are allowed. Acceptable metadata value types are NSString, NSDate, NSNumber and HKQuantity.
        completion - The completion handler will return the resulting HKQuantitySample(s) for the series. Note that it is possible for a single HKQuantitySeriesSampleBuilder to produce multiple samples. If data could not be inserted because of an authorization failure, samples will be nil and and an error with code HKErrorAuthorizationDenied or HKErrorAuthorizationNotDetermined will be returned. If the resulting sample(s) could not be accessed after they have been created, then samples will be nil and an error with code HKErrorDatabaseInaccessible will be returned. Any other error indicates the resulting samples could not be returned. After calling this method, the receiver will be considered invalid and calling any other method will result in an error.
      • finishSeriesWithMetadataEndDateCompletion

        public void finishSeriesWithMetadataEndDateCompletion​(NSDictionary<java.lang.String,​?> metadata,
                                                              NSDate endDate,
                                                              HKQuantitySeriesSampleBuilder.Block_finishSeriesWithMetadataEndDateCompletion completion)
        finishSeriesWithMetadata:endDate:completion: Finalizes the series and returns the resulting HKQuantitySample(s). Call this method when all quantities for the series have been inserted. The completion handler will return the resulting HKQuantitySample(s) Note that it is possible for a single HKQuantitySeriesSampleBuilder to produce multiple samples. If no quantity data was added, then samples will be nil and an error will be returned. After calling this method, the receiver will be considered invalid and calling any other method will result in an error.
        Parameters:
        metadata - Optional metadata may be added to associate with the series. Predefined keys are found in HKMetadata.h, or custom NSString keys used by the client are allowed. Acceptable metadata value types are NSString, NSDate, NSNumber and HKQuantity.
        endDate - Optional date at which the produced sample(s) end. An HKErrorInvalidArgument will be returned if endDate is earlier than the receiver's startDate, or is earlier than the dateInterval.endDate of any inserted quantity.
        completion - The completion handler will return the resulting HKQuantitySample(s) for the series. Note that it is possible for a single HKQuantitySeriesSampleBuilder to produce multiple samples. If data could not be inserted because of an authorization failure, samples will be nil and and an error with code HKErrorAuthorizationDenied or HKErrorAuthorizationNotDetermined will be returned. If the resulting sample(s) could not be accessed after they have been created, then samples will be nil and an error with code HKErrorDatabaseInaccessible will be returned. Any other error indicates the resulting samples could not be returned. After calling this method, the receiver will be considered invalid and calling any other method will result in an error.
      • hash_static

        public static long hash_static()
      • initWithHealthStoreQuantityTypeStartDateDevice

        public HKQuantitySeriesSampleBuilder initWithHealthStoreQuantityTypeStartDateDevice​(HKHealthStore healthStore,
                                                                                            HKQuantityType quantityType,
                                                                                            NSDate startDate,
                                                                                            HKDevice device)
        initWithHealthStore:quantityType:device: The designated initializer to create an HKQuantitySeriesSampleBuilder. The HKHealthStore is retained during the life of the object for the saving of the series data and final return of the series sample.
        Parameters:
        healthStore - Specifies the HKHealthStore object to use for building the series.
        quantityType - Specifies the quantity type for which to build the series.
        startDate - The date from which the produced sample(s) start.
        device - The optional device represents the HKDevice from which the data is provided.
      • insertQuantityDateError

        public boolean insertQuantityDateError​(HKQuantity quantity,
                                               NSDate date,
                                               org.moe.natj.general.ptr.Ptr<NSError> error)
        insertQuantity:date:completion: Associate a new quantity with the receiver at a specific instantaneous date interval. This method acts as a convenience for insertQuantity:dateInterval:completion: where dateInterval has a duration of 0.
        Parameters:
        quantity - The quantity to insert.
        date - The start date associated with the quantity. If this is the same start date as a previously-provided quantity, the new value will replace the old value. An HKErrorInvalidArgument will be returned if date is earlier than the receiver's startDate.
      • insertQuantityDateIntervalError

        public boolean insertQuantityDateIntervalError​(HKQuantity quantity,
                                                       NSDateInterval dateInterval,
                                                       org.moe.natj.general.ptr.Ptr<NSError> error)
        insertQuantity:dateInterval:completion: Associate a new quantity with the receiver with a specific date interval. Use this method to add a quantity to the series. The quantity must have a unit that is compatible with the receiver's quantity type. See -[HKQuantityType isCompatibleWithUnit:]. Note that quantities may be inserted in any order, but will be sorted by dateInterval.startDate when the series is finished.
        Parameters:
        quantity - The quantity to insert.
        dateInterval - The dateInterval associated with the quantity. If dateInterval.startDate is the same as a previously-provided quantity, the new value will replace the old value. An HKErrorInvalidArgument will be returned if dateInterval.startDate is earlier than the receiver's startDate.
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • quantityType

        public HKQuantityType quantityType()
        [@property] quantityType
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • startDate

        public NSDate startDate()
        [@property] startDate
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()