mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-01 22:42:51 +08:00
39 lines
1.0 KiB
Objective-C
39 lines
1.0 KiB
Objective-C
//
|
|
// RKPropertyMapping.m
|
|
// RestKit
|
|
//
|
|
// Created by Blake Watters on 8/27/12.
|
|
// Copyright (c) 2012 RestKit. All rights reserved.
|
|
//
|
|
|
|
#import "RKPropertyMapping.h"
|
|
|
|
@interface RKPropertyMapping ()
|
|
@property (nonatomic, strong, readwrite) NSString *sourceKeyPath;
|
|
@property (nonatomic, strong, readwrite) NSString *destinationKeyPath;
|
|
@end
|
|
|
|
@implementation RKPropertyMapping
|
|
|
|
- (id)copyWithZone:(NSZone *)zone
|
|
{
|
|
RKPropertyMapping *copy = [[[self class] allocWithZone:zone] init];
|
|
copy.sourceKeyPath = self.sourceKeyPath;
|
|
copy.destinationKeyPath = self.destinationKeyPath;
|
|
return copy;
|
|
}
|
|
|
|
- (BOOL)isEqualToMapping:(RKPropertyMapping *)otherMapping
|
|
{
|
|
return [otherMapping isMemberOfClass:[self class]] &&
|
|
[self.sourceKeyPath isEqual:otherMapping.sourceKeyPath] &&
|
|
[self.destinationKeyPath isEqual:otherMapping.destinationKeyPath];
|
|
}
|
|
|
|
- (NSString *)description
|
|
{
|
|
return [NSString stringWithFormat:@"<%@: %p %@ => %@>", self.class, self, self.sourceKeyPath, self.destinationKeyPath];
|
|
}
|
|
|
|
@end
|