PartialObject

public struct PartialObject<O> where O : CoreStoreObject
extension PartialObject: CustomDebugStringConvertible, CoreStoreDebugStringConvertible

A PartialObject is only used when overriding getters and setters for CoreStoreObject properties. Custom getters and setters are implemented as a closure that “overrides” the default property getter/setter. The closure receives a PartialObject<O>, which acts as a fast, type-safe KVC interface for CoreStoreObject. The reason a CoreStoreObject instance is not passed directly is because the Core Data runtime is not aware of CoreStoreObject properties’ static typing, and so loading those info everytime KVO invokes this accessor method incurs a heavy performance hit (especially in KVO-heavy operations such as ListMonitor observing.) When accessing the property value from PartialObject<O>, make sure to use PartialObject<O>.persistentValue(for:) instead of PartialObject<O>.value(for:), which would unintentionally execute the same closure again recursively.

Field.Stored accessors/mutators

  • Returns the value for the property identified by a given key.

    Declaration

    Swift

    public func value<V>(for property: (O) -> FieldContainer<O>.Stored<V>) -> V where V : FieldStorableType
  • Returns the value for the property identified by a given key.

    Declaration

    Swift

    public func value<V>(for property: (O) -> FieldContainer<O>.Virtual<V>) -> V
  • Returns the value for the specified property from the managed object’s private internal storage.

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    Declaration

    Swift

    public func primitiveValue<V>(for property: (O) -> FieldContainer<O>.Stored<V>) -> V where V : FieldStorableType
  • Returns the value for the specified property from the managed object’s private internal storage.

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    Declaration

    Swift

    public func primitiveValue<V>(for property: (O) -> FieldContainer<O>.Virtual<V>) -> V?
  • Returns the value for the specified property from the managed object’s private internal storage.

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    Declaration

    Swift

    public func primitiveValue<V>(for property: (O) -> FieldContainer<O>.Coded<V>) -> V?
  • Sets in the object’s private internal storage the value of a given property.

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    Declaration

    Swift

    public func setPrimitiveValue<V>(_ value: V, for property: (O) -> FieldContainer<O>.Stored<V>) where V : FieldStorableType
  • Sets in the object’s private internal storage the value of a given property.

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    Declaration

    Swift

    public func setPrimitiveValue<V>(_ value: V, for property: (O) -> FieldContainer<O>.Virtual<V>)

Value.Required accessors/mutators

  • Returns the value for the property identified by a given key.

    Declaration

    Swift

    public func value<V>(for property: (O) -> ValueContainer<O>.Required<V>) -> V where V : ImportableAttributeType
  • Sets the property of the receiver specified by a given key to a given value.

    Declaration

    Swift

    public func setValue<V>(_ value: V, for property: (O) -> ValueContainer<O>.Required<V>) where V : ImportableAttributeType
  • Returns the value for the specified property from the managed object’s private internal storage.

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    Declaration

    Swift

    public func primitiveValue<V>(for property: (O) -> ValueContainer<O>.Required<V>) -> V where V : ImportableAttributeType
  • Sets in the object’s private internal storage the value of a given property.

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    Declaration

    Swift

    public func setPrimitiveValue<V>(_ value: V, for property: (O) -> ValueContainer<O>.Required<V>) where V : ImportableAttributeType

Value.Optional utilities

  • Returns the value for the property identified by a given key.

    Declaration

    Swift

    public func value<V>(for property: (O) -> ValueContainer<O>.Optional<V>) -> V? where V : ImportableAttributeType
  • Sets the property of the receiver specified by a given key to a given value.

    Declaration

    Swift

    public func setValue<V>(_ value: V?, for property: (O) -> ValueContainer<O>.Optional<V>) where V : ImportableAttributeType
  • Returns the value for the specified property from the managed object’s private internal storage.

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    Declaration

    Swift

    public func primitiveValue<V>(for property: (O) -> ValueContainer<O>.Optional<V>) -> V? where V : ImportableAttributeType
  • Sets in the object’s private internal storage the value of a given property.

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    Declaration

    Swift

    public func setPrimitiveValue<V>(_ value: V?, for property: (O) -> ValueContainer<O>.Optional<V>) where V : ImportableAttributeType

Transformable.Required utilities

  • Returns the value for the property identified by a given key.

    Declaration

    Swift

    public func value<V>(for property: (O) -> TransformableContainer<O>.Required<V>) -> V where V : NSCoding, V : NSCopying
  • Sets the property of the receiver specified by a given key to a given value.

    Declaration

    Swift

    public func setValue<V>(_ value: V, for property: (O) -> TransformableContainer<O>.Required<V>) where V : NSCoding, V : NSCopying
  • Returns the value for the specified property from the managed object’s private internal storage.

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    Declaration

    Swift

    public func primitiveValue<V>(for property: (O) -> TransformableContainer<O>.Required<V>) -> V where V : NSCoding, V : NSCopying
  • Sets in the object’s private internal storage the value of a given property.

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    Declaration

    Swift

    public func setPrimitiveValue<V>(_ value: V, for property: (O) -> TransformableContainer<O>.Required<V>) where V : NSCoding, V : NSCopying

Transformable.Optional utilities

  • Returns the value for the property identified by a given key.

    Declaration

    Swift

    public func value<V>(for property: (O) -> TransformableContainer<O>.Optional<V>) -> V? where V : NSCoding, V : NSCopying
  • Sets the property of the receiver specified by a given key to a given value.

    Declaration

    Swift

    public func setValue<V>(_ value: V?, for property: (O) -> TransformableContainer<O>.Optional<V>) where V : NSCoding, V : NSCopying
  • Returns the value for the specified property from the managed object’s private internal storage.

    This method does not invoke the access notification methods (willAccessValue(forKey:) and didAccessValue(forKey:)). This method is used primarily by subclasses that implement custom accessor methods that need direct access to the receiver’s private storage.

    Declaration

    Swift

    public func primitiveValue<V>(for property: (O) -> TransformableContainer<O>.Optional<V>) -> V? where V : NSCoding, V : NSCopying
  • Sets in the object’s private internal storage the value of a given property.

    Sets in the receiver’s private internal storage the value of the property specified by key to value.

    Declaration

    Swift

    public func setPrimitiveValue<V>(_ value: V?, for property: (O) -> TransformableContainer<O>.Optional<V>) where V : NSCoding, V : NSCopying

CustomDebugStringConvertible

  • Declaration

    Swift

    public var debugDescription: String { get }