Class HKWorkout

    • Constructor Detail

      • HKWorkout

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

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

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

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

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

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

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

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

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

        public static long hash_static()
      • 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

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

        public static HKWorkout new_objc()
      • 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)
      • superclass_static

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

        public static boolean supportsSecureCoding()
      • version_static

        public static long version_static()
      • workoutWithActivityTypeStartDateEndDate

        @Deprecated
        public static HKWorkout workoutWithActivityTypeStartDateEndDate​(long workoutActivityType,
                                                                        @NotNull
                                                                        @NotNull NSDate startDate,
                                                                        @NotNull
                                                                        @NotNull NSDate endDate)
        Deprecated.
        workoutWithActivityType:startDate:endDate:
        Parameters:
        workoutActivityType - The activity type of the workout
        startDate - The point in time that the workout was started
        endDate - The point in time that the workout was ended API-Since: 8.0 Deprecated-Since: 17.0 Deprecated-Message: Use HKWorkoutBuilder
      • workoutWithActivityTypeStartDateEndDateDurationTotalEnergyBurnedTotalDistanceDeviceMetadata

        @Deprecated
        public static HKWorkout workoutWithActivityTypeStartDateEndDateDurationTotalEnergyBurnedTotalDistanceDeviceMetadata​(long workoutActivityType,
                                                                                                                            @NotNull
                                                                                                                            @NotNull NSDate startDate,
                                                                                                                            @NotNull
                                                                                                                            @NotNull NSDate endDate,
                                                                                                                            double duration,
                                                                                                                            @Nullable
                                                                                                                            @Nullable HKQuantity totalEnergyBurned,
                                                                                                                            @Nullable
                                                                                                                            @Nullable HKQuantity totalDistance,
                                                                                                                            @Nullable
                                                                                                                            @Nullable HKDevice device,
                                                                                                                            @Nullable
                                                                                                                            @Nullable NSDictionary<java.lang.String,​?> metadata)
        Deprecated.
        workoutWithActivityType:startDate:endDate:duration:totalEnergyBurned:totalDistance:device:metadata: If the optional total parameters are specified, matching samples that add up to the calculated total quantities should be associated with this workout using addSamples:toWorkout:completion: in HKHealthStore.
        Parameters:
        workoutActivityType - The activity type of the workout
        startDate - The point in time that the workout was started
        endDate - The point in time that the workout was ended
        duration - The duration of the workout. If 0, the difference between startDate and endDate is used.
        totalEnergyBurned - The amount of energy that was burned during the workout. (Optional)
        totalDistance - The total distance that was traveled during the workout. (Optional)
        device - The HKDevice associated with the workout. (Optional)
        metadata - Metadata for the workout. (Optional) API-Since: 9.0 Deprecated-Since: 17.0 Deprecated-Message: Use HKWorkoutBuilder
      • workoutWithActivityTypeStartDateEndDateDurationTotalEnergyBurnedTotalDistanceMetadata

        @Deprecated
        public static HKWorkout workoutWithActivityTypeStartDateEndDateDurationTotalEnergyBurnedTotalDistanceMetadata​(long workoutActivityType,
                                                                                                                      @NotNull
                                                                                                                      @NotNull NSDate startDate,
                                                                                                                      @NotNull
                                                                                                                      @NotNull NSDate endDate,
                                                                                                                      double duration,
                                                                                                                      @Nullable
                                                                                                                      @Nullable HKQuantity totalEnergyBurned,
                                                                                                                      @Nullable
                                                                                                                      @Nullable HKQuantity totalDistance,
                                                                                                                      @Nullable
                                                                                                                      @Nullable NSDictionary<java.lang.String,​?> metadata)
        Deprecated.
        workoutWithActivityType:startDate:endDate:duration:totalEnergyBurned:totalDistance:metadata: If the optional total parameters are specified, matching samples that add up to the calculated total quantities should be associated with this workout using addSamples:toWorkout:completion: in HKHealthStore.
        Parameters:
        workoutActivityType - The activity type of the workout
        startDate - The point in time that the workout was started
        endDate - The point in time that the workout was ended
        duration - The duration of the workout. If 0, the difference between startDate and endDate is used.
        totalEnergyBurned - The amount of energy that was burned during the workout. (Optional)
        totalDistance - The total distance that was traveled during the workout. (Optional)
        metadata - Metadata for the workout. (Optional) API-Since: 8.0 Deprecated-Since: 17.0 Deprecated-Message: Use HKWorkoutBuilder
      • workoutWithActivityTypeStartDateEndDateWorkoutEventsTotalEnergyBurnedTotalDistanceDeviceMetadata

        @Deprecated
        public static HKWorkout workoutWithActivityTypeStartDateEndDateWorkoutEventsTotalEnergyBurnedTotalDistanceDeviceMetadata​(long workoutActivityType,
                                                                                                                                 @NotNull
                                                                                                                                 @NotNull NSDate startDate,
                                                                                                                                 @NotNull
                                                                                                                                 @NotNull NSDate endDate,
                                                                                                                                 @Nullable
                                                                                                                                 @Nullable NSArray<? extends HKWorkoutEvent> workoutEvents,
                                                                                                                                 @Nullable
                                                                                                                                 @Nullable HKQuantity totalEnergyBurned,
                                                                                                                                 @Nullable
                                                                                                                                 @Nullable HKQuantity totalDistance,
                                                                                                                                 @Nullable
                                                                                                                                 @Nullable HKDevice device,
                                                                                                                                 @Nullable
                                                                                                                                 @Nullable NSDictionary<java.lang.String,​?> metadata)
        Deprecated.
        workoutWithActivityType:startDate:endDate:workoutEvents:totalEnergyBurned:totalDistance:metadata If the optional total parameters are specified, matching samples that add up to the calculated total quantities should be associated with this workout using addSamples:toWorkout:completion: in HKHealthStore.
        Parameters:
        workoutActivityType - The activity type of the workout
        startDate - The point in time that the workout was started
        endDate - The point in time that the workout was ended
        workoutEvents - An array of HKWorkoutEvents. The workout's duration is derived from these events. (Optional)
        totalEnergyBurned - The amount of energy that was burned during the workout. (Optional)
        totalDistance - The total distance that was traveled during the workout. (Optional)
        device - The HKDevice associated with the workout. (Optional)
        metadata - Metadata for the workout. (Optional) API-Since: 9.0 Deprecated-Since: 17.0 Deprecated-Message: Use HKWorkoutBuilder
      • workoutWithActivityTypeStartDateEndDateWorkoutEventsTotalEnergyBurnedTotalDistanceMetadata

        @Deprecated
        public static HKWorkout workoutWithActivityTypeStartDateEndDateWorkoutEventsTotalEnergyBurnedTotalDistanceMetadata​(long workoutActivityType,
                                                                                                                           @NotNull
                                                                                                                           @NotNull NSDate startDate,
                                                                                                                           @NotNull
                                                                                                                           @NotNull NSDate endDate,
                                                                                                                           @Nullable
                                                                                                                           @Nullable NSArray<? extends HKWorkoutEvent> workoutEvents,
                                                                                                                           @Nullable
                                                                                                                           @Nullable HKQuantity totalEnergyBurned,
                                                                                                                           @Nullable
                                                                                                                           @Nullable HKQuantity totalDistance,
                                                                                                                           @Nullable
                                                                                                                           @Nullable NSDictionary<java.lang.String,​?> metadata)
        Deprecated.
        workoutWithActivityType:startDate:endDate:workoutEvents:totalEnergyBurned:totalDistance:metadata If the optional total parameters are specified, matching samples that add up to the calculated total quantities should be associated with this workout using addSamples:toWorkout:completion: in HKHealthStore.
        Parameters:
        workoutActivityType - The activity type of the workout
        startDate - The point in time that the workout was started
        endDate - The point in time that the workout was ended
        workoutEvents - An array of HKWorkoutEvents. The workout's duration is derived from these events. (Optional)
        totalEnergyBurned - The amount of energy that was burned during the workout. (Optional)
        totalDistance - The total distance that was traveled during the workout. (Optional)
        metadata - Metadata for the workout. (Optional) API-Since: 8.0 Deprecated-Since: 17.0 Deprecated-Message: Use HKWorkoutBuilder
      • workoutWithActivityTypeStartDateEndDateWorkoutEventsTotalEnergyBurnedTotalDistanceTotalSwimmingStrokeCountDeviceMetadata

        @Deprecated
        public static HKWorkout workoutWithActivityTypeStartDateEndDateWorkoutEventsTotalEnergyBurnedTotalDistanceTotalSwimmingStrokeCountDeviceMetadata​(long workoutActivityType,
                                                                                                                                                         @NotNull
                                                                                                                                                         @NotNull NSDate startDate,
                                                                                                                                                         @NotNull
                                                                                                                                                         @NotNull NSDate endDate,
                                                                                                                                                         @Nullable
                                                                                                                                                         @Nullable NSArray<? extends HKWorkoutEvent> workoutEvents,
                                                                                                                                                         @Nullable
                                                                                                                                                         @Nullable HKQuantity totalEnergyBurned,
                                                                                                                                                         @Nullable
                                                                                                                                                         @Nullable HKQuantity totalDistance,
                                                                                                                                                         @Nullable
                                                                                                                                                         @Nullable HKQuantity totalSwimmingStrokeCount,
                                                                                                                                                         @Nullable
                                                                                                                                                         @Nullable HKDevice device,
                                                                                                                                                         @Nullable
                                                                                                                                                         @Nullable NSDictionary<java.lang.String,​?> metadata)
        Deprecated.
        workoutWithActivityType:startDate:endDate:workoutEvents:totalEnergyBurned:totalDistance:totalSwimmingStrokeCount:device:metadata: If the optional total parameters are specified, matching samples that add up to the calculated total quantities should be associated with this workout using addSamples:toWorkout:completion: in HKHealthStore.
        Parameters:
        workoutActivityType - The activity type of the workout
        startDate - The point in time that the workout was started
        endDate - The point in time that the workout was ended
        workoutEvents - An array of HKWorkoutEvents. The workout's duration is derived from these events. (Optional)
        totalEnergyBurned - The amount of energy that was burned during the workout. (Optional)
        totalDistance - The total distance that was traveled during the workout. (Optional)
        totalSwimmingStrokeCount - The total count of swimming strokes that was accumulated during the workout. (Optional)
        device - The HKDevice associated with the workout. (Optional)
        metadata - Metadata for the workout. (Optional) API-Since: 10.0 Deprecated-Since: 17.0 Deprecated-Message: Use HKWorkoutBuilder
      • duration

        public double duration()
        [@property] duration The length of time that a workout was recording The duration is derived from the start and end dates of the workout and takes into account periods that the workout was paused. Periods that the workout was paused are based off of the workoutEvents property.
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
        Overrides:
        _supportsSecureCoding in class HKSample
      • totalDistance

        @Nullable
        @Deprecated
        public @Nullable HKQuantity totalDistance()
        Deprecated.
        [@property] totalDistance The total distance that was traveled during a workout This metric should represent the total distance traveled during the course of the workout. It should be a quantity with a unit representing length. API-Since: 8.0 Deprecated-Since: 100000.0 Deprecated-Message: Use statisticsForType: passing the HKQuantityType for the desired distance type
      • totalEnergyBurned

        @Nullable
        @Deprecated
        public @Nullable HKQuantity totalEnergyBurned()
        Deprecated.
        [@property] totalEnergyBurned The amount of energy that was burned during a workout This metric should represent the total active energy burned during the course of the workout. It should be a quantity with a unit representing energy. API-Since: 8.0 Deprecated-Since: 100000.0 Deprecated-Message: Use statisticsForType: passing the HKQuantityType for HKQuantityTypeIdentifierActiveEnergyBurned
      • totalSwimmingStrokeCount

        @Nullable
        @Deprecated
        public @Nullable HKQuantity totalSwimmingStrokeCount()
        Deprecated.
        [@property] totalSwimmingStrokeCount The total count of swimming strokes that was accumulated during a workout This metric should represent the total count of swimming strokes accumulated during the course of the workout. It should be a quantity with a unit representing count. API-Since: 10.0 Deprecated-Since: 100000.0 Deprecated-Message: Use statisticsForType: passing the HKQuantityType for HKQuantityTypeIdentifierSwimmingStrokeCount
      • workoutActivityType

        public long workoutActivityType()
        [@property] workoutActivityType Represents the activity that the user was performing during a workout
      • workoutEvents

        @Nullable
        public @Nullable NSArray<? extends HKWorkoutEvent> workoutEvents()
        [@property] workoutEvents An array of HKWorkoutEvents that occurred during a workout. These events will be ordered by date in ascending order. All events must take place between the start date and end date of the workout. The first workout event should never be a resume event because it is assumed that the workout begins in a running state.
      • totalFlightsClimbed

        @Nullable
        @Deprecated
        public @Nullable HKQuantity totalFlightsClimbed()
        Deprecated.
        [@property] totalFlightsClimbed The total count of flights climbed during a workout This metric should represent the total count of flights accumulated during the course of the workout. It should be a quantity with a unit representing count. API-Since: 11.0 Deprecated-Since: 100000.0 Deprecated-Message: Use statisticsForType: passing the HKQuantityType for HKQuantityTypeIdentifierFlightClimbed
      • workoutWithActivityTypeStartDateEndDateWorkoutEventsTotalEnergyBurnedTotalDistanceTotalFlightsClimbedDeviceMetadata

        @Deprecated
        public static HKWorkout workoutWithActivityTypeStartDateEndDateWorkoutEventsTotalEnergyBurnedTotalDistanceTotalFlightsClimbedDeviceMetadata​(long workoutActivityType,
                                                                                                                                                    @NotNull
                                                                                                                                                    @NotNull NSDate startDate,
                                                                                                                                                    @NotNull
                                                                                                                                                    @NotNull NSDate endDate,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable NSArray<? extends HKWorkoutEvent> workoutEvents,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable HKQuantity totalEnergyBurned,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable HKQuantity totalDistance,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable HKQuantity totalFlightsClimbed,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable HKDevice device,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable NSDictionary<java.lang.String,​?> metadata)
        Deprecated.
        workoutWithActivityType:startDate:endDate:workoutEvents:totalEnergyBurned:totalDistance:totalFlightsClimbed:device:metadata: If the optional total parameters are specified, matching samples that add up to the calculated total quantities should be associated with this workout using addSamples:toWorkout:completion: in HKHealthStore.
        Parameters:
        workoutActivityType - The activity type of the workout
        startDate - The point in time that the workout was started
        endDate - The point in time that the workout was ended
        workoutEvents - An array of HKWorkoutEvents. The workout's duration is derived from these events. (Optional)
        totalEnergyBurned - The amount of energy that was burned during the workout. (Optional)
        totalDistance - The total distance that was traveled during the workout. (Optional)
        totalFlightsClimbed - The total count of flights climbed that was accumulated during the workout. (Optional)
        device - The HKDevice associated with the workout. (Optional)
        metadata - Metadata for the workout. (Optional) API-Since: 11.0 Deprecated-Since: 17.0 Deprecated-Message: Use HKWorkoutBuilder
      • allStatistics

        @NotNull
        public @NotNull NSDictionary<? extends HKQuantityType,​? extends HKStatistics> allStatistics()
        [@property] allStatistics A dictionary of statistics per quantity type during the workout This dictionary will contain HKStatistics objects containing the statistics by quantity sample type for all of the samples that have been added to the workout. API-Since: 16.0
      • statisticsForType

        @Nullable
        public @Nullable HKStatistics statisticsForType​(@NotNull
                                                        @NotNull HKQuantityType quantityType)
        statisticsForType: Returns an HKStatistics object containing the statistics for all the samples of the given type that have been added to the workout. If there are no samples of the given type then nil is returned.
        Parameters:
        quantityType - The quantity type to gather statistics about. API-Since: 16.0
      • workoutActivities

        @NotNull
        public @NotNull NSArray<? extends HKWorkoutActivity> workoutActivities()
        [@property] workoutActivities An array of HKWorkoutActivities that were performed during a workout. These activities will be ordered by date in ascending order. All activities must take place between the start date and end date of the workout. API-Since: 16.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.