mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 12:27:52 +08:00
Introduce RKPropertyMapping abstract superclass for RKAttributeMapping and RKRelationshipMapping.
Add primitives for working with attribute, relationship, and property mapping objects.
This commit is contained in:
54
Code/ObjectMapping/RKPropertyMapping.h
Normal file
54
Code/ObjectMapping/RKPropertyMapping.h
Normal file
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// RKPropertyMapping.h
|
||||
// RestKit
|
||||
//
|
||||
// Created by Blake Watters on 8/27/12.
|
||||
// Copyright (c) 2009-2012 RestKit. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
RKPropertyMapping is an abstract class for describing the properties being mapped
|
||||
within an object or entity mapping. It defines the common interface for its concrete
|
||||
subclasses RKAttributeMapping and RKRelationshipMapping.
|
||||
*/
|
||||
@interface RKPropertyMapping : NSObject <NSCopying>
|
||||
|
||||
/**
|
||||
A key path on the source object from which to get information that is to be mapped onto
|
||||
the destination object.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) NSString *sourceKeyPath;
|
||||
|
||||
/**
|
||||
A key path on the destination object on which to set information that has been mapped from
|
||||
the source object.
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) NSString *destinationKeyPath;
|
||||
|
||||
/**
|
||||
Compares the receiving property mapping to another property mapping.
|
||||
|
||||
Two property mappings are equal if they are of the same type (i.e. an attribute or a
|
||||
relationship mapping) and specify a mapping from the same source key path to the
|
||||
same destination key path.
|
||||
|
||||
@param otherMapping The property mapping object with which to compare the receiver.
|
||||
@return YES if otherMapping specifies the same mapping as the receiver, otherwise NO.
|
||||
*/
|
||||
- (BOOL)isEqualToMapping:(RKPropertyMapping *)otherMapping;
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user