EFMapping Class Reference
Inherits from | NSObject |
Declared in | EFMapping.h EFMapping.m |
Overview
EFMapping
instances define how data from an external source, such as JSON, needs to be applied to instances.
Tasks
Factories
-
+ mapping:
Factory method for creating an
EFMapping
instance -
+ mappingForArray:
Factory method for creating an
EFMapping
instance for an array -
+ mappingForDictionary:
Factory method for creating an
EFMapping
instance for a dictionary
Properties
-
externalKey
Key used in the external source
property -
internalKey
Key used in local entities
property -
– setKey:
Convenience method to set both the externalKey and internalKey properties to the same value
-
internalClass
Class of value in local entity
property -
formatter
Formatter applied to value before setting it on local entity
property -
transformer
Value transformer applied to value before setting it on local entity
property -
transformationBlock
Block applied to value before setting it on local entity
property -
requires
An
propertyEFRequires
instance, or anNSArray
ofEFRequires
instances, for which the incoming value should pass
Number (incl. BOOL, integer, floats etc.)
-
+ mappingForNumberWithKey:
Convenience method for creating a number mapping
-
+ mappingForNumberWithExternalKey:internalKey:
Convenience method for creating a number mapping
NSString
-
+ mappingForStringWithKey:
Convenience method for creating a string mapping
-
+ mappingForStringWithExternalKey:internalKey:
Convenience method for creating a string mapping
Classes
-
+ mappingForClass:key:
Convenience method for creating a class mapping
-
+ mappingForClass:externalKey:internalKey:
Convenience method for creating a class mapping
NSArray of classes
-
+ mappingForArrayOfClass:key:
Convenience method for creating a class mapping for an array
-
+ mappingForArrayOfClass:externalKey:internalKey:
Convenience method for creating a class mapping for an array
Properties
externalKey
Key used in the external source
@property (nonatomic, copy) NSString *externalKey
Discussion
Key used in the external source
Declared In
EFMapping.h
formatter
Formatter applied to value before setting it on local entity
@property (nonatomic, strong) NSFormatter *formatter
Discussion
Formatter applied to value before setting it on local entity
Declared In
EFMapping.h
internalClass
Class of value in local entity
@property (nonatomic, assign) Class internalClass
Discussion
Class of value in local entity
Declared In
EFMapping.h
internalKey
Key used in local entities
@property (nonatomic, copy) NSString *internalKey
Discussion
Key used in local entities
Declared In
EFMapping.h
requires
An EFRequires
instance, or an NSArray
of EFRequires
instances, for which the incoming value should pass
@property (nonatomic, strong) id<EFRequires> requires
Discussion
An EFRequires
instance, or an NSArray
of EFRequires
instances, for which the incoming value should pass
Declared In
EFMapping.h
Class Methods
mapping:
Factory method for creating an EFMapping
instance
+ (instancetype)mapping:(EFMappingFactoryBlock)factoryBlock
Parameters
- factoryBlock
Block in which you apply to properties to be used for this mapping
Return Value
EFMapping
instance
Discussion
Factory method for creating an EFMapping
instance
Declared In
EFMapping.h
mappingForArray:
Factory method for creating an EFMapping
instance for an array
+ (instancetype)mappingForArray:(EFMappingFactoryBlock)factoryBlock
Parameters
- factoryBlock
Block in which you apply to properties to be used for this mapping
Return Value
EFMapping
instance
Discussion
Factory method for creating an EFMapping
instance for an array
Declared In
EFMapping.h
mappingForArrayOfClass:externalKey:internalKey:
Convenience method for creating a class mapping for an array
+ (instancetype)mappingForArrayOfClass:(Class)internalClass externalKey:(NSString *)externalKey internalKey:(NSString *)internalKey
Parameters
- internalClass
Class of value in local entity
- externalKey
Key used in the external source
- internalKey
Key used in local entities
Return Value
EFMapping
instance
Discussion
Convenience method for creating a class mapping for an array
Declared In
EFMapping.h
mappingForArrayOfClass:key:
Convenience method for creating a class mapping for an array
+ (instancetype)mappingForArrayOfClass:(Class)internalClass key:(NSString *)key
Parameters
- internalClass
Class of value in local entity
- key
Key to set on externalKey and internalKey
Return Value
EFMapping
instance
Discussion
Convenience method for creating a class mapping for an array
Declared In
EFMapping.h
mappingForClass:externalKey:internalKey:
Convenience method for creating a class mapping
+ (instancetype)mappingForClass:(Class)internalClass externalKey:(NSString *)externalKey internalKey:(NSString *)internalKey
Parameters
- internalClass
Class of value in local entity
- externalKey
Key used in the external source
- internalKey
Key used in local entities
Return Value
EFMapping
instance
Discussion
Convenience method for creating a class mapping
Declared In
EFMapping.h
mappingForClass:key:
Convenience method for creating a class mapping
+ (instancetype)mappingForClass:(Class)internalClass key:(NSString *)key
Parameters
- internalClass
Class of value in local entity
- key
Key to set on externalKey and internalKey
Return Value
EFMapping
instance
Discussion
Convenience method for creating a class mapping
Declared In
EFMapping.h
mappingForDictionary:
Factory method for creating an EFMapping
instance for a dictionary
+ (instancetype)mappingForDictionary:(EFMappingFactoryBlock)factoryBlock
Parameters
- factoryBlock
Block in which you apply to properties to be used for this mapping
Return Value
EFMapping
instance
Discussion
Factory method for creating an EFMapping
instance for a dictionary
Declared In
EFMapping.h
mappingForNumberWithExternalKey:internalKey:
Convenience method for creating a number mapping
+ (instancetype)mappingForNumberWithExternalKey:(NSString *)externalKey internalKey:(NSString *)internalKey
Parameters
- externalKey
Key used in the external source
- internalKey
Key used in local entities
Return Value
EFMapping
instance
Discussion
Convenience method for creating a number mapping
Declared In
EFMapping.h
mappingForNumberWithKey:
Convenience method for creating a number mapping
+ (instancetype)mappingForNumberWithKey:(NSString *)key
Parameters
- key
Key to set on externalKey and internalKey
Return Value
EFMapping
instance
Discussion
Convenience method for creating a number mapping
Declared In
EFMapping.h
mappingForStringWithExternalKey:internalKey:
Convenience method for creating a string mapping
+ (instancetype)mappingForStringWithExternalKey:(NSString *)externalKey internalKey:(NSString *)internalKey
Parameters
- externalKey
Key used in the external source
- internalKey
Key used in local entities
Return Value
EFMapping
instance
Discussion
Convenience method for creating a string mapping
Declared In
EFMapping.h
mappingForStringWithKey:
Convenience method for creating a string mapping
+ (instancetype)mappingForStringWithKey:(NSString *)key
Parameters
- key
Key to set on externalKey and internalKey
Return Value
EFMapping
instance
Discussion
Convenience method for creating a string mapping
Declared In
EFMapping.h
Instance Methods
setKey:
Convenience method to set both the externalKey and internalKey properties to the same value
- (void)setKey:(NSString *)key
Parameters
- key
Key to set on externalKey and internalKey
Discussion
Convenience method to set both the externalKey and internalKey properties to the same value
Declared In
EFMapping.h