Fix compile errors
[pithos-ios] / Classes / LoadBalancerProtocol.m
1 //
2 //  LoadBalancerProtocol.m
3 //  OpenStack
4 //
5 //  Created by Michael Mayo on 4/29/11.
6 //  Copyright 2011 __MyCompanyName__. All rights reserved.
7 //
8
9 #import "LoadBalancerProtocol.h"
10 #import "NSObject+NSCoding.h"
11
12
13 @implementation LoadBalancerProtocol
14
15 @synthesize name, port;
16
17 #pragma mark - Serialization
18
19 - (void)encodeWithCoder: (NSCoder *)coder {
20     [self autoEncodeWithCoder:coder];    
21 }
22
23 - (id)initWithCoder:(NSCoder *)coder {
24     self = [super init];
25     if (self) {
26         [self autoDecode:coder];
27     }
28     return self;
29 }
30
31 #pragma mark - Memory Management
32
33 - (void)dealloc {
34     [name release];
35     [super dealloc];
36 }
37
38 #pragma mark - JSON
39
40 + (LoadBalancerProtocol *)fromJSON:(NSDictionary *)dict {
41     LoadBalancerProtocol *protocol = [[[LoadBalancerProtocol alloc] init] autorelease];
42     protocol.name = [dict objectForKey:@"name"];
43     protocol.port = [[dict objectForKey:@"port"] intValue];
44     return protocol;
45 }
46
47 @end