mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-21 13:54:15 -07:00
Replace NodeStatus object with Obj-C Class
This commit is contained in:
parent
a08246ce5d
commit
7a12d8193b
5 changed files with 63 additions and 63 deletions
31
ZeroTier One/NodeStatus.m
Normal file
31
ZeroTier One/NodeStatus.m
Normal file
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// NodeStatus.m
|
||||
// ZeroTier One
|
||||
//
|
||||
// Created by Grant Limberg on 8/4/16.
|
||||
// Copyright © 2016 ZeroTier, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NodeStatus.h"
|
||||
|
||||
@implementation NodeStatus
|
||||
|
||||
- (id)initWithJsonData:(NSDictionary*)jsonData
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
if(self) {
|
||||
_address = (NSString*)[jsonData objectForKey:@"address"];
|
||||
_publicIdentity = (NSString*)[jsonData objectForKey:@"publicIdentity"];
|
||||
_online = [(NSNumber*)[jsonData objectForKey:@"online"] boolValue];
|
||||
_tcpFallbackActive = [(NSNumber*)[jsonData objectForKey:@"tcpFallbackActive"] boolValue];
|
||||
_versionMajor = [(NSNumber*)[jsonData objectForKey:@"versionMajor"] intValue];
|
||||
_versionMinor = [(NSNumber*)[jsonData objectForKey:@"versionMinor"] intValue];
|
||||
_versionRev = [(NSNumber*)[jsonData objectForKey:@"versionRev"] intValue];
|
||||
_version = (NSString*)[jsonData objectForKey:@"version"];
|
||||
_clock = [(NSNumber*)[jsonData objectForKey:@"clock"] unsignedLongLongValue];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue