File: DBSerializableProtocol.h

package info (click to toggle)
python-stone 3.3.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,956 kB
  • sloc: python: 21,786; objc: 498; sh: 29; makefile: 11
file content (44 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
///
/// Copyright (c) 2016 Dropbox, Inc. All rights reserved.
///

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

///
/// Protocol which all Obj-C SDK API route objects must implement, otherwise a compiler-warning
/// is generated.
///
@protocol DBSerializable <NSObject>

///
/// Class method which returns a json-compatible dictionary representation of the
/// supplied object.
///
/// @param instance An instance of the API object to be serialized.
///
/// @return A serialized, json-compatible dictionary representation of the API object.
///
+ (nullable NSDictionary<NSString *, id> *)serialize:(id)instance;

///
/// Class method which returns an instantiation of the supplied object as represented
/// by a json-compatible dictionary.
///
/// @param dict A dictionary representation of the API object to be serialized.
///
/// @return A deserialized, instantiation of the API object.
///
+ (id)deserialize:(NSDictionary<NSString *, id> *)dict;

///
/// Description method.
///
/// @return A human-readable representation of the current object.
///
- (NSString *)description;

@end

NS_ASSUME_NONNULL_END