Class CNSaveRequest

  • All Implemented Interfaces:
    NSObject

    public class CNSaveRequest
    extends NSObject
    Specifies the changes to save. Create a new save request for each save execution on the contact store. Can have many changes batched into one save request. Do not access objects in the save request when it is executing. A save request only applies the changes to the objects. If there are overlapping changes with multiple, concurrent CNSaveRequests then the last saved change wins. If adding an object (contact, group, container) and it is already in the contact store then the executing save request will fail to add that object and will return the error CNErrorCodeInsertedRecordAlreadyExists with CNErrorUserInfoAffectedRecordsKey value as an array containing that object. If updating/deleting an object (contact, group, container) and it is not in the contact store then the executing save request will fail to update/delete that object and will return the error CNErrorCodeRecordDoesNotExist with CNErrorUserInfoAffectedRecordsKey value as an array containing that object.
    • Constructor Detail

      • CNSaveRequest

        protected CNSaveRequest​(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()
      • 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

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

        public static java.lang.Object 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()
      • version_static

        public static long version_static()
      • addContactToContainerWithIdentifier

        public void addContactToContainerWithIdentifier​(CNMutableContact contact,
                                                        java.lang.String identifier)
        Add a new contact to the contact store. The contact may be modified by the executing save request. If the contact was previously specified to be deleted in the save request that will no longer occur.
        Parameters:
        contact - The new contact to add.
        identifier - The container identifier to add the new contact to. Set to nil for the default container.
      • addGroupToContainerWithIdentifier

        public void addGroupToContainerWithIdentifier​(CNMutableGroup group,
                                                      java.lang.String identifier)
        Add a new group to the contact store. If the group was previously specified to be deleted in the save request that will no longer occur.
        Parameters:
        group - The new group to add.
        identifier - The container identifier to add the new group to. Set to nil for the default container.
      • addMemberToGroup

        public void addMemberToGroup​(CNContact contact,
                                     CNGroup group)
        Add a new member to a group. If the membership was previously specified to be deleted in the save request that will no longer occur.
        Parameters:
        contact - The new member to add to the group.
        group - The group to add the member to.
      • deleteContact

        public void deleteContact​(CNMutableContact contact)
        Delete a contact from the contact store. If the contact was previously specified to be added in the save request that will no longer occur.
      • deleteGroup

        public void deleteGroup​(CNMutableGroup group)
        Delete a group from the contact store. The contacts in the group are not deleted. If the group was previously specified to be added in the save request that will no longer occur.
      • removeMemberFromGroup

        public void removeMemberFromGroup​(CNContact contact,
                                          CNGroup group)
        Remove a member from a group. The contact is not deleted. It is only removed as a member of the group. If the membership was previously specified to be added in the save request that will no longer occur.
        Parameters:
        contact - The member to remove from the group.
        group - The group to remove the member from.
      • updateContact

        public void updateContact​(CNMutableContact contact)
        Update an existing contact in the contact store. The contact must already exist in the contact store. The contact may be modified by the executing save request.
      • updateGroup

        public void updateGroup​(CNMutableGroup group)
        Update an existing group in the contact store. The group must already exist in the contact store.