blob: 0a2a23b8be2473c5e263f46ae6a2c2986127cdd3 (
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
// SDLTBTState.m
//
#import "SDLTBTState.h"
SDLTBTState *SDLTBTState_ROUTE_UPDATE_REQUEST = nil;
SDLTBTState *SDLTBTState_ROUTE_ACCEPTED = nil;
SDLTBTState *SDLTBTState_ROUTE_REFUSED = nil;
SDLTBTState *SDLTBTState_ROUTE_CANCELLED = nil;
SDLTBTState *SDLTBTState_ETA_REQUEST = nil;
SDLTBTState *SDLTBTState_NEXT_TURN_REQUEST = nil;
SDLTBTState *SDLTBTState_ROUTE_STATUS_REQUEST = nil;
SDLTBTState *SDLTBTState_ROUTE_SUMMARY_REQUEST = nil;
SDLTBTState *SDLTBTState_TRIP_STATUS_REQUEST = nil;
SDLTBTState *SDLTBTState_ROUTE_UPDATE_REQUEST_TIMEOUT = nil;
NSArray *SDLTBTState_values = nil;
@implementation SDLTBTState
+ (SDLTBTState *)valueOf:(NSString *)value {
for (SDLTBTState *item in SDLTBTState.values) {
if ([item.value isEqualToString:value]) {
return item;
}
}
return nil;
}
+ (NSArray *)values {
if (SDLTBTState_values == nil) {
SDLTBTState_values = @[
SDLTBTState.ROUTE_UPDATE_REQUEST,
SDLTBTState.ROUTE_ACCEPTED,
SDLTBTState.ROUTE_REFUSED,
SDLTBTState.ROUTE_CANCELLED,
SDLTBTState.ETA_REQUEST,
SDLTBTState.NEXT_TURN_REQUEST,
SDLTBTState.ROUTE_STATUS_REQUEST,
SDLTBTState.ROUTE_SUMMARY_REQUEST,
SDLTBTState.TRIP_STATUS_REQUEST,
SDLTBTState.ROUTE_UPDATE_REQUEST_TIMEOUT,
];
}
return SDLTBTState_values;
}
+ (SDLTBTState *)ROUTE_UPDATE_REQUEST {
if (SDLTBTState_ROUTE_UPDATE_REQUEST == nil) {
SDLTBTState_ROUTE_UPDATE_REQUEST = [[SDLTBTState alloc] initWithValue:@"ROUTE_UPDATE_REQUEST"];
}
return SDLTBTState_ROUTE_UPDATE_REQUEST;
}
+ (SDLTBTState *)ROUTE_ACCEPTED {
if (SDLTBTState_ROUTE_ACCEPTED == nil) {
SDLTBTState_ROUTE_ACCEPTED = [[SDLTBTState alloc] initWithValue:@"ROUTE_ACCEPTED"];
}
return SDLTBTState_ROUTE_ACCEPTED;
}
+ (SDLTBTState *)ROUTE_REFUSED {
if (SDLTBTState_ROUTE_REFUSED == nil) {
SDLTBTState_ROUTE_REFUSED = [[SDLTBTState alloc] initWithValue:@"ROUTE_REFUSED"];
}
return SDLTBTState_ROUTE_REFUSED;
}
+ (SDLTBTState *)ROUTE_CANCELLED {
if (SDLTBTState_ROUTE_CANCELLED == nil) {
SDLTBTState_ROUTE_CANCELLED = [[SDLTBTState alloc] initWithValue:@"ROUTE_CANCELLED"];
}
return SDLTBTState_ROUTE_CANCELLED;
}
+ (SDLTBTState *)ETA_REQUEST {
if (SDLTBTState_ETA_REQUEST == nil) {
SDLTBTState_ETA_REQUEST = [[SDLTBTState alloc] initWithValue:@"ETA_REQUEST"];
}
return SDLTBTState_ETA_REQUEST;
}
+ (SDLTBTState *)NEXT_TURN_REQUEST {
if (SDLTBTState_NEXT_TURN_REQUEST == nil) {
SDLTBTState_NEXT_TURN_REQUEST = [[SDLTBTState alloc] initWithValue:@"NEXT_TURN_REQUEST"];
}
return SDLTBTState_NEXT_TURN_REQUEST;
}
+ (SDLTBTState *)ROUTE_STATUS_REQUEST {
if (SDLTBTState_ROUTE_STATUS_REQUEST == nil) {
SDLTBTState_ROUTE_STATUS_REQUEST = [[SDLTBTState alloc] initWithValue:@"ROUTE_STATUS_REQUEST"];
}
return SDLTBTState_ROUTE_STATUS_REQUEST;
}
+ (SDLTBTState *)ROUTE_SUMMARY_REQUEST {
if (SDLTBTState_ROUTE_SUMMARY_REQUEST == nil) {
SDLTBTState_ROUTE_SUMMARY_REQUEST = [[SDLTBTState alloc] initWithValue:@"ROUTE_SUMMARY_REQUEST"];
}
return SDLTBTState_ROUTE_SUMMARY_REQUEST;
}
+ (SDLTBTState *)TRIP_STATUS_REQUEST {
if (SDLTBTState_TRIP_STATUS_REQUEST == nil) {
SDLTBTState_TRIP_STATUS_REQUEST = [[SDLTBTState alloc] initWithValue:@"TRIP_STATUS_REQUEST"];
}
return SDLTBTState_TRIP_STATUS_REQUEST;
}
+ (SDLTBTState *)ROUTE_UPDATE_REQUEST_TIMEOUT {
if (SDLTBTState_ROUTE_UPDATE_REQUEST_TIMEOUT == nil) {
SDLTBTState_ROUTE_UPDATE_REQUEST_TIMEOUT = [[SDLTBTState alloc] initWithValue:@"ROUTE_UPDATE_REQUEST_TIMEOUT"];
}
return SDLTBTState_ROUTE_UPDATE_REQUEST_TIMEOUT;
}
@end
|