KBAManagedObjectPropertyMapping

@protocol KBAManagedObjectPropertyMapping <NSObject>

Protocol for objects that map JSON keys to managed object property names.

  • Return the entity property name for the JSON key. For example, first_name -> firstName.

    Declaration

    Objective-C

    - (nonnull NSString *)entityPropertyKeyForJSONKey:(nonnull NSString *)JSONKey
                                           entityName:
                                               (nonnull NSString *)entityName;

    Parameters

    JSONKey

    The JSON key

    entityName

    The entity name

    Return Value

    The entity property name

  • Return the JSON key for the entity property name. For example, firstName -> first_name.

    Declaration

    Objective-C

    - (nonnull NSString *)
        JSONKeyForEntityPropertyKey:(nonnull NSString *)propertyKey
                         entityName:(nonnull NSString *)entityName;

    Parameters

    propertyKey

    The JSON key

    entityName

    The entity name

    Return Value

    The JSON key

  • Return the entity property value for property key and entity name in context.

    Declaration

    Objective-C

    - (nonnull id)
        entityPropertyValueForEntityPropertyKey:(nonnull NSString *)propertyKey
                                          value:(nullable id)value
                                     entityName:(nonnull NSString *)entityName
                                        context:(nonnull NSManagedObjectContext *)
                                                    context;

    Parameters

    propertyKey

    The entity property key

    value

    The JSON value

    entityName

    The entity name

    context

    The managed object context

    Return Value

    The entity property value

  • Return the JSON value for the entity property key, value, and entity name in context.

    Declaration

    Objective-C

    - (nonnull id)JSONValueForEntityPropertyKey:(nonnull NSString *)propertyKey
                                          value:(nullable id)value
                                     entityName:(nonnull NSString *)entityName
                                        context:(nonnull NSManagedObjectContext *)
                                                    context;

    Parameters

    propertyKey

    The entity property key

    value

    The entity property value

    entityName

    The entity name

    context

    The managed object context

    Return Value

    The JSON value