summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLIgnitionStatus.m
blob: ff069f0a0184ec021648f7c1aded7ad245f61cc2 (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
//  SDLIgnitionStatus.m
//


#import "SDLIgnitionStatus.h"

SDLIgnitionStatus *SDLIgnitionStatus_UNKNOWN = nil;
SDLIgnitionStatus *SDLIgnitionStatus_OFF = nil;
SDLIgnitionStatus *SDLIgnitionStatus_ACCESSORY = nil;
SDLIgnitionStatus *SDLIgnitionStatus_RUN = nil;
SDLIgnitionStatus *SDLIgnitionStatus_START = nil;
SDLIgnitionStatus *SDLIgnitionStatus_INVALID = nil;

NSArray *SDLIgnitionStatus_values = nil;

@implementation SDLIgnitionStatus

+ (SDLIgnitionStatus *)valueOf:(NSString *)value {
    for (SDLIgnitionStatus *item in SDLIgnitionStatus.values) {
        if ([item.value isEqualToString:value]) {
            return item;
        }
    }
    return nil;
}

+ (NSArray *)values {
    if (SDLIgnitionStatus_values == nil) {
        SDLIgnitionStatus_values = @[
            SDLIgnitionStatus.UNKNOWN,
            SDLIgnitionStatus.OFF,
            SDLIgnitionStatus.ACCESSORY,
            SDLIgnitionStatus.RUN,
            SDLIgnitionStatus.START,
            SDLIgnitionStatus.INVALID,
        ];
    }
    return SDLIgnitionStatus_values;
}

+ (SDLIgnitionStatus *)UNKNOWN {
    if (SDLIgnitionStatus_UNKNOWN == nil) {
        SDLIgnitionStatus_UNKNOWN = [[SDLIgnitionStatus alloc] initWithValue:@"UNKNOWN"];
    }
    return SDLIgnitionStatus_UNKNOWN;
}

+ (SDLIgnitionStatus *)OFF {
    if (SDLIgnitionStatus_OFF == nil) {
        SDLIgnitionStatus_OFF = [[SDLIgnitionStatus alloc] initWithValue:@"OFF"];
    }
    return SDLIgnitionStatus_OFF;
}

+ (SDLIgnitionStatus *)ACCESSORY {
    if (SDLIgnitionStatus_ACCESSORY == nil) {
        SDLIgnitionStatus_ACCESSORY = [[SDLIgnitionStatus alloc] initWithValue:@"ACCESSORY"];
    }
    return SDLIgnitionStatus_ACCESSORY;
}

+ (SDLIgnitionStatus *)RUN {
    if (SDLIgnitionStatus_RUN == nil) {
        SDLIgnitionStatus_RUN = [[SDLIgnitionStatus alloc] initWithValue:@"RUN"];
    }
    return SDLIgnitionStatus_RUN;
}

+ (SDLIgnitionStatus *)START {
    if (SDLIgnitionStatus_START == nil) {
        SDLIgnitionStatus_START = [[SDLIgnitionStatus alloc] initWithValue:@"START"];
    }
    return SDLIgnitionStatus_START;
}

+ (SDLIgnitionStatus *)INVALID {
    if (SDLIgnitionStatus_INVALID == nil) {
        SDLIgnitionStatus_INVALID = [[SDLIgnitionStatus alloc] initWithValue:@"INVALID"];
    }
    return SDLIgnitionStatus_INVALID;
}

@end