Class NSManagedObject

    • Constructor Detail

      • NSManagedObject

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

        public static boolean contextShouldIgnoreUnmodeledPropertyChanges()
        Distinguish between changes that should and should not dirty the object for any key unknown to Core Data. 10.5 & earlier default to NO. 10.6 and later default to YES. Similarly, transient attributes may be individually flagged as not dirtying the object by adding +(BOOL)contextShouldIgnoreChangesFor where is the property name.
      • debugDescription_static

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

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

        public static NSEntityDescription entity_static()
        The Entity represented by this subclass. This method is only legal to call on subclasses of NSManagedObject that represent a single entity in the model.
      • fetchRequest

        public static NSFetchRequest<?> fetchRequest()
        A new fetch request initialized with the Entity represented by this subclass. This property's getter is only legal to call on subclasses of NSManagedObject that represent a single entity in the model.
      • 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()
      • awakeFromFetch

        public void awakeFromFetch()
        invoked after a fetch or after unfaulting (commonly used for computing derived values from the persisted properties)
      • awakeFromInsert

        public void awakeFromInsert()
        invoked after an insert (commonly used for initializing special default/initial settings)
      • awakeFromSnapshotEvents

        public void awakeFromSnapshotEvents​(long flags)
        Callback for undo, redo, and other multi-property state resets
      • changedValues

        public NSDictionary<java.lang.String,​?> changedValues()
        returns a dictionary with the keys and (new) values that have been changed since last fetching or saving the object (this is implemented efficiently without firing relationship faults)
      • changedValuesForCurrentEvent

        public NSDictionary<java.lang.String,​?> changedValuesForCurrentEvent()
      • committedValuesForKeys

        public NSDictionary<java.lang.String,​?> committedValuesForKeys​(NSArray<java.lang.String> keys)
        returns a dictionary of the last fetched or saved keys and values of this object. Pass nil to get all persistent modeled properties.
      • didAccessValueForKey

        public void didAccessValueForKey​(java.lang.String key)
        read notification (together with willAccessValueForKey used to maintain inverse relationships, to fire faults, etc.) - each read access has to be wrapped in this method pair (in the same way as each write access has to be wrapped in the KVO method pair)
      • didSave

        public void didSave()
        commonly used to notify other objects after a save
      • didTurnIntoFault

        public void didTurnIntoFault()
        commonly used to clear out additional transient values or caches
      • faultingState

        public long faultingState()
        Allow developers to determine if an object is in a transitional phase when receiving a KVO notification. Returns 0 if the object is fully initialized as a managed object and not transitioning to or from another state
      • hasChanges

        public boolean hasChanges()
      • hasFaultForRelationshipNamed

        public boolean hasFaultForRelationshipNamed​(java.lang.String key)
        returns a Boolean indicating if the relationship for the specified key is a fault. If a value of NO is returned, the resulting relationship is a realized object; otherwise the relationship is a fault. If the specified relationship is a fault, calling this method does not result in the fault firing.
      • hasPersistentChangedValues

        public boolean hasPersistentChangedValues()
        returns YES if any persistent properties do not compare isEqual to their last saved state. Relationship faults will not be unnecessarily fired. This differs from the existing -hasChanges method which is a simple dirty flag and also includes transient properties
      • initWithContext

        public NSManagedObject initWithContext​(NSManagedObjectContext moc)
        Returns a new object, inserted into managedObjectContext. This method is only legal to call on subclasses of NSManagedObject that represent a single entity in the model.
      • isDeleted

        public boolean isDeleted()
      • isFault

        public boolean isFault()
        this information is useful in many situations when computations are optional - this can be used to avoid growing the object graph unnecessarily (which allows to control performance as it can avoid time consuming fetches from databases)
      • isInserted

        public boolean isInserted()
        state - methods
      • isUpdated

        public boolean isUpdated()
      • objectIDsForRelationshipNamed

        public NSArray<? extends NSManagedObjectID> objectIDsForRelationshipNamed​(java.lang.String key)
        returns an array of objectIDs for the contents of a relationship. to-one relationships will return an NSArray with a single NSManagedObjectID. Optional relationships may return an empty NSArray. The objectIDs will be returned in an NSArray regardless of the type of the relationship.
      • prepareForDeletion

        public void prepareForDeletion()
        Callback before delete propagation while the object is still alive. Useful to perform custom propagation before the relationships are torn down or reconfigure KVO observers.
      • primitiveValueForKey

        public java.lang.Object primitiveValueForKey​(java.lang.String key)
        primitive methods give access to the generic dictionary storage from subclasses that implement explicit accessors like -setName/-name to add custom document logic
      • setPrimitiveValueForKey

        public void setPrimitiveValueForKey​(java.lang.Object value,
                                            java.lang.String key)
      • setValueForKey

        public void setValueForKey​(java.lang.Object value,
                                   java.lang.String key)
        KVC - overridden to access generic dictionary storage unless subclasses explicitly provide accessors
        Overrides:
        setValueForKey in class NSObject
      • validateForDelete

        public boolean validateForDelete​(org.moe.natj.general.ptr.Ptr<NSError> error)
      • validateForInsert

        public boolean validateForInsert​(org.moe.natj.general.ptr.Ptr<NSError> error)
      • validateForUpdate

        public boolean validateForUpdate​(org.moe.natj.general.ptr.Ptr<NSError> error)
      • validateValueForKeyError

        public boolean validateValueForKeyError​(org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> value,
                                                java.lang.String key,
                                                org.moe.natj.general.ptr.Ptr<NSError> error)
        KVC
        Overrides:
        validateValueForKeyError in class NSObject
      • valueForKey

        public java.lang.Object valueForKey​(java.lang.String key)
        KVC - overridden to access generic dictionary storage unless subclasses explicitly provide accessors
        Overrides:
        valueForKey in class NSObject
      • willAccessValueForKey

        public void willAccessValueForKey​(java.lang.String key)
        read notification
      • willChangeValueForKey

        public void willChangeValueForKey​(java.lang.String key)
        KVO change notification
        Overrides:
        willChangeValueForKey in class NSObject
      • willChangeValueForKeyWithSetMutationUsingObjects

        public void willChangeValueForKeyWithSetMutationUsingObjects​(java.lang.String inKey,
                                                                     long inMutationKind,
                                                                     NSSet<?> inObjects)
        Description copied from class: NSObject
        Given a key that identifies an _unordered_ to-many relationship, send -observeValueForKeyPath:ofObject:change:context: notification messages to each observer registered for the key, including those that are registered with other objects using key paths that locate the keyed value in this object. The passed-in mutation kind corresponds to an NSMutableSet method. The passed-in set must contain the set that would be passed to the corresponding NSMutableSet method. Invocations of these methods must always be paired, with identical arguments. The value of the NSKeyValueChangeKindKey entry in change dictionaries in notifications resulting from use of these methods depends on the passed-in mutationKind value: - NSKeyValueUnionSetMutation -> NSKeyValueChangeInsertion - NSKeyValueMinusSetMutation -> NSKeyValueChangeRemoval - NSKeyValueIntersectSetMutation -> NSKeyValueChangeRemoval - NSKeyValueSetSetMutation -> NSKeyValueChangeReplacement The change dictionaries may also contain optional entries: - The NSKeyValueChangeOldKey entry, if present (only for for NSKeyValueChangeRemoval and NSKeyValueChangeReplacement), contains the set of objects that were removed. - The NSKeyValueChangeNewKey entry, if present (only for NSKeyValueChangeInsertion and NSKeyValueChangeReplacement), contains the set of objects that were added.
        Overrides:
        willChangeValueForKeyWithSetMutationUsingObjects in class NSObject
      • willSave

        public void willSave()
        commonly used to compute persisted values from other transient/scratchpad values, to set timestamps, etc. - this method can have "side effects" on the persisted values
      • willTurnIntoFault

        public void willTurnIntoFault()
        invoked automatically by the Core Data framework before receiver is converted (back) to a fault. This method is the companion of the -didTurnIntoFault method, and may be used to (re)set state which requires access to property values (for example, observers across keypaths.) The default implementation does nothing.