summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLOnTBTClientState.m
blob: ee0dc1efc55cd895cabfb33028f4894e2a264be0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//  SDLOnTBTClientState.m
//

#import "SDLOnTBTClientState.h"

#import "SDLNames.h"
#import "SDLTBTState.h"


@implementation SDLOnTBTClientState

- (instancetype)init {
    if (self = [super initWithName:NAMES_OnTBTClientState]) {
    }
    return self;
}

- (instancetype)initWithDictionary:(NSMutableDictionary *)dict {
    if (self = [super initWithDictionary:dict]) {
    }
    return self;
}

- (void)setState:(SDLTBTState *)state {
    if (state != nil) {
        [parameters setObject:state forKey:NAMES_state];
    } else {
        [parameters removeObjectForKey:NAMES_state];
    }
}

- (SDLTBTState *)state {
    NSObject *obj = [parameters objectForKey:NAMES_state];
    if (obj == nil || [obj isKindOfClass:SDLTBTState.class]) {
        return (SDLTBTState *)obj;
    } else {
        return [SDLTBTState valueOf:(NSString *)obj];
    }
}

@end