hank
2018-06-21 2cfb267ecc1bea8bc564466a1620535018dce77c
commit | author | age
655e66 1 /*
H 2  * Copyright (C) 2017 Twitter, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 /**
19  This header is private to the Twitter Core SDK and not exposed for public SDK consumption
20  */
a0a843 21
H 22 #import <Foundation/Foundation.h>
23 #import <UIKit/UIKit.h>
24
25 NS_ASSUME_NONNULL_BEGIN
26
27 @interface TWTRDictUtil : NSObject
28
655e66 29 /**
H 30  *  Returns an array for the specified key. Returns nil if the value does not exist for the key or the return type is not an array.
31  */
32 + (NSArray *)twtr_arrayForKey:(NSString *)key inDict:(NSDictionary *)dict;
a0a843 33
H 34 /**
655e66 35  *  Returns a CGFloat for the specified key.
a0a843 36  */
655e66 37 + (CGFloat)twtr_CGFloatForKey:(NSString *)key inDict:(NSDictionary *)dict;
H 38
39 /**
40  *  Returns a double for the specified key.
41  */
42 + (double)twtr_doubleForKey:(NSString *)key inDict:(NSDictionary *)dict;
43
44 /**
45  *  Returns a bool for the specified key.
46  */
47 + (BOOL)twtr_boolForKey:(NSString *)key inDict:(NSDictionary *)dict;
48
49 /**
50  *  Returns an int for the specified key.
51  */
52 + (NSInteger)twtr_intForKey:(NSString *)key inDict:(NSDictionary *)dict;
53
54 /**
55  *  Returns a long long for the specified key.
56  */
57 + (long long)twtr_longlongForKey:(NSString *)key inDict:(NSDictionary *)dict;
58
59 /**
60  *  Returns an unsigned integer for the specified key.
61  */
62 + (NSUInteger)twtr_unsignedIntegerForKey:(NSString *)key inDict:(NSDictionary *)dict;
63
64 /**
65  *  Returns a string from a number for the specified key. Returns nil if the value does not exist for the key or the return type is not a string.
66  */
67 + (NSString *)twtr_stringFromNumberForKey:(NSString *)key inDict:(NSDictionary *)dict;
68
69 /**
70  *  Returns a generic object for the specified key. Returns nil if the value does not exist.
71  */
72 + (id)twtr_objectForKey:(NSString *)key inDict:(NSDictionary *)dict;
73
74 /**
75  *  Returns a string for the specified key. Returns nil if the value does not exist for the key or the return type is not a string.
76  */
77 + (NSString *)twtr_stringForKey:(NSString *)key inDict:(NSDictionary *)dict;
78
79 /**
80  *  Returns a date for the specified key. Returns nil if the value does not exist for the key or the return type is not a date.
81  */
82 + (NSDate *)twtr_dateForKey:(NSString *)key inDict:(NSDictionary *)dict;
83
84 /**
85  *  Returns a dictionary for the specified key. Returns nil if the value does not exist for the key or the return type is not a dictionary.
86  */
87 + (NSDictionary *)twtr_dictForKey:(NSString *)key inDict:(NSDictionary *)dict;
a0a843 88
H 89 @end
90
91 NS_ASSUME_NONNULL_END