summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLAddSubMenu.m
blob: f30a23c163c805116808a869338dd3785385fd2f (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//  SDLAddSubMenu.m

#import "SDLAddSubMenu.h"

#import "SDLNames.h"

@implementation SDLAddSubMenu

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

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

- (instancetype)initWithId:(NSNumber *)menuId menuName:(NSString *)menuName {
    return [self initWithId:menuId menuName:menuName position:nil];
}

- (instancetype)initWithId:(NSNumber *)menuId menuName:(NSString *)menuName position:(NSNumber *)position {
    self = [self init];
    if (!self) {
        return nil;
    }
    
    self.menuID = menuId;
    self.menuName = menuName;
    self.position = position;
    
    return self;
}

- (void)setMenuID:(NSNumber *)menuID {
    if (menuID != nil) {
        [parameters setObject:menuID forKey:NAMES_menuID];
    } else {
        [parameters removeObjectForKey:NAMES_menuID];
    }
}

- (NSNumber *)menuID {
    return [parameters objectForKey:NAMES_menuID];
}

- (void)setPosition:(NSNumber *)position {
    if (position != nil) {
        [parameters setObject:position forKey:NAMES_position];
    } else {
        [parameters removeObjectForKey:NAMES_position];
    }
}

- (NSNumber *)position {
    return [parameters objectForKey:NAMES_position];
}

- (void)setMenuName:(NSString *)menuName {
    if (menuName != nil) {
        [parameters setObject:menuName forKey:NAMES_menuName];
    } else {
        [parameters removeObjectForKey:NAMES_menuName];
    }
}

- (NSString *)menuName {
    return [parameters objectForKey:NAMES_menuName];
}

@end