Newer
Older
XinYang_IOS / XYSW / YH_Untis / Understruck.h
@zhangfeng zhangfeng on 7 Dec 2023 1 KB 1.8.0
//
//  Understruck.h
//  YHScrollView_Test
//
//  Created by Jim on 2021/9/4.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface Understruck : NSObject

/**
 *  获取类属性名 及对应类型
 *
 *  @param cls 自定义类型
 *
 *  @return key 类属性名 value 属性对应类型
 */
+ (NSDictionary *)propertiesForClass:(Class)cls;
+ (id)populateObject:(id)obj fromDictionary:(NSDictionary*)dict;
+ (id)populateObject:(id)obj fromDictionary:(NSDictionary*)dict exclude:(NSArray*)excludeArray;
+ (id)objectWithClass:(Class)cls fromDictionary:(NSDictionary*)dict;
+ (id)decodeObject:(Class)clazz from:(id)object;
+ (NSDictionary*)dictionaryForObject:(id)obj;
+ (NSDictionary*)dictionaryForObject:(id)obj include:(NSArray*)includeArray;
+ (NSMutableDictionary*)mutableDictionaryForObject:(id)obj;
+ (NSMutableDictionary*)mutableDictionaryForObject:(id)obj include:(NSArray*)includeArray;
+ (NSArray*)arrayOfClass:(Class)cls fromArray:(NSArray*)array;
+ (NSMutableArray*)mutableArrayOfClass:(Class)cls fromArray:(NSArray*)array;
+ (NSString *)populateJsonFrom:(Class)clazz fromArray:(NSArray *)array;

@end

NS_ASSUME_NONNULL_END