QNInetAddress.h 869 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // QNInetAddress.h
  3. // QiniuSDK
  4. //
  5. // Created by 杨森 on 2020/7/27.
  6. // Copyright © 2020 Qiniu. All rights reserved.
  7. //
  8. #import "QNDns.h"
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface QNInetAddress : NSObject <QNIDnsNetworkAddress>
  11. @property(nonatomic, copy)NSString *hostValue;
  12. @property(nonatomic, copy)NSString *ipValue;
  13. @property(nonatomic, strong)NSNumber *ttlValue;
  14. @property(nonatomic, strong)NSNumber *timestampValue;
  15. @property(nonatomic, copy)NSString *sourceValue;
  16. /// 构造方法 addressData为json
  17. /// @param addressInfo 地址信息,类型可能为String / Dictionary / Data / 遵循 QNInetAddressDelegate的实例
  18. + (instancetype)inetAddress:(id)addressInfo;
  19. /// 是否有效,根据时间戳判断
  20. - (BOOL)isValid;
  21. /// 对象转json
  22. - (NSString *)toJsonInfo;
  23. /// 对象转字典
  24. - (NSDictionary *)toDictionary;
  25. @end
  26. NS_ASSUME_NONNULL_END