summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLSeatMemoryAction.m
blob: 76f51923824a234f6a39fbdbedda201afb0b61eb (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//  SDLSeatMemoryAction.m
//

#import "SDLSeatMemoryAction.h"
#import "SDLNames.h"
#import "NSMutableDictionary+Store.h"

NS_ASSUME_NONNULL_BEGIN

@implementation SDLSeatMemoryAction

- (instancetype)initWithId:(UInt8)id action:(SDLSeatMemoryActionType)action {
    self = [super init];
    if (!self) {
        return nil;
    }

    self.id = @(id);
    self.action = action;

    return self;
}

- (instancetype)initWithId:(UInt8)id label:(nullable NSString*)label action:(SDLSeatMemoryActionType)action {
    self = [self initWithId:id action:action];
    if (!self) {
        return nil;
    }

    self.label = label;
    return self;
}

- (void)setId:(NSNumber<SDLInt> *)id {
    [store sdl_setObject:id forName:SDLNameId];
}

- (NSNumber<SDLInt> *)id {
    return [store sdl_objectForName:SDLNameId];
}

- (void)setLabel:(nullable NSString *)label {
    [store sdl_setObject:label forName:SDLNameLabel];
}

- (nullable NSString *)label {
    return [store sdl_objectForName:SDLNameLabel];
}

- (void)setAction:(SDLSeatMemoryActionType)action {
    [store sdl_setObject:action forName:SDLNameAction];
}

- (SDLSeatMemoryActionType)action {
    return [store sdl_objectForName:SDLNameAction];
}
@end


NS_ASSUME_NONNULL_END