summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLRDSData.m
blob: 2d177e6aa3327427e55b174cfb6fb61661f12f2a (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//
//  SDLRDSData.m
//

#import "SDLRDSData.h"
#include "SDLRPCParameterNames.h"
#import "NSMutableDictionary+Store.h"

NS_ASSUME_NONNULL_BEGIN

@implementation SDLRDSData

- (instancetype)initWithProgramService:(nullable NSString *)programService radioText:(nullable NSString *)radioText clockText:(nullable NSString *)clockText programIdentification:(nullable NSString *)programIdentification programType:(nullable NSNumber<SDLInt> *)programType trafficProgramIdentification:(nullable NSNumber<SDLBool> *)trafficProgramIdentification trafficAnnouncementIdentification:(nullable NSNumber<SDLBool> *)trafficAnnouncementIdentification region:(nullable NSString *)region {
    self = [self init];
    if (!self) {
        return nil;
    }
    self.programService = programService;
    self.radioText = radioText;
    self.clockText = clockText;
    self.programIdentification = programIdentification;
    self.programType = programType;
    self.trafficProgramIdentification = trafficProgramIdentification;
    self.trafficAnnouncementIdentification = trafficAnnouncementIdentification;
    self.region = region;
    return self;
}

- (void)setProgramService:(nullable NSString *)programService {
    [self.store sdl_setObject:programService forName:SDLRPCParameterNameProgramService];
}

- (nullable NSString *)programService {
    return [self.store sdl_objectForName:SDLRPCParameterNameProgramService ofClass:NSString.class error:nil];
}

- (void)setRadioText:(nullable NSString *)radioText {
    [self.store sdl_setObject:radioText forName:SDLRPCParameterNameRadioText];
}

- (nullable NSString *)radioText {
    return [self.store sdl_objectForName:SDLRPCParameterNameRadioText ofClass:NSString.class error:nil];
}

- (void)setClockText:(nullable NSString *)clockText {
    [self.store sdl_setObject:clockText forName:SDLRPCParameterNameClockText];
}

- (nullable NSString *)clockText {
    return [self.store sdl_objectForName:SDLRPCParameterNameClockText ofClass:NSString.class error:nil];
}

- (void)setProgramIdentification:(nullable NSString *)programIdentification {
    [self.store sdl_setObject:programIdentification forName:SDLRPCParameterNameProgramIdentification];
}

- (nullable NSString *)programIdentification {
    return [self.store sdl_objectForName:SDLRPCParameterNameProgramIdentification ofClass:NSString.class error:nil];
}

- (void)setProgramType:(nullable NSNumber<SDLInt> *)programType {
    [self.store sdl_setObject:programType forName:SDLRPCParameterNameProgramType];
}

- (nullable NSNumber<SDLInt> *)programType {
    return [self.store sdl_objectForName:SDLRPCParameterNameProgramType ofClass:NSNumber.class error:nil];
}

- (void)setTrafficProgramIdentification:(nullable NSNumber<SDLBool> *)trafficProgramIdentification {
    [self.store sdl_setObject:trafficProgramIdentification forName:SDLRPCParameterNameTrafficProgramIdentification];
}

- (nullable NSNumber<SDLBool> *)trafficProgramIdentification {
    return [self.store sdl_objectForName:SDLRPCParameterNameTrafficProgramIdentification ofClass:NSNumber.class error:nil];
}

- (void)setTrafficAnnouncementIdentification:(nullable NSNumber<SDLBool> *)trafficAnnouncementIdentification {
    [self.store sdl_setObject:trafficAnnouncementIdentification forName:SDLRPCParameterNameTrafficAnnouncementIdentification];
}

- (nullable NSNumber<SDLBool> *)trafficAnnouncementIdentification {
    return [self.store sdl_objectForName:SDLRPCParameterNameTrafficAnnouncementIdentification ofClass:NSNumber.class error:nil];
}

- (void)setRegion:(nullable NSString *)region {
    [self.store sdl_setObject:region forName:SDLRPCParameterNameRegion];
}

- (nullable NSString *)region {
    return [self.store sdl_objectForName:SDLRPCParameterNameRegion ofClass:NSString.class error:nil];
}

@end

NS_ASSUME_NONNULL_END