diff options
author | Joel Fischer <joel@livioradio.com> | 2015-02-05 17:23:18 -0500 |
---|---|---|
committer | Joel Fischer <joel@livioradio.com> | 2015-02-05 17:23:18 -0500 |
commit | f68012783353cfd83acb9da9062a94a15b326221 (patch) | |
tree | 5b6c3ea95ce777282a20db0ac0b24ff11708de6d /SmartDeviceLink-iOS/SmartDeviceLink/SDLComponentVolumeStatus.m | |
parent | d19e1482db454f0ccee3c60ab1ea886fd98b41be (diff) | |
download | sdl_ios-f68012783353cfd83acb9da9062a94a15b326221.tar.gz |
Simplify the folder structure
Library files are now within the framework's folder
Fix some warnings
Diffstat (limited to 'SmartDeviceLink-iOS/SmartDeviceLink/SDLComponentVolumeStatus.m')
-rw-r--r-- | SmartDeviceLink-iOS/SmartDeviceLink/SDLComponentVolumeStatus.m | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/SDLComponentVolumeStatus.m b/SmartDeviceLink-iOS/SmartDeviceLink/SDLComponentVolumeStatus.m new file mode 100644 index 000000000..a30e51ac3 --- /dev/null +++ b/SmartDeviceLink-iOS/SmartDeviceLink/SDLComponentVolumeStatus.m @@ -0,0 +1,83 @@ +// SDLComponentVolumeStatus.m +// +// Copyright (c) 2014 Ford Motor Company. All rights reserved. + +#import "SDLComponentVolumeStatus.h" + +SDLComponentVolumeStatus* SDLComponentVolumeStatus_UNKNOWN = nil; +SDLComponentVolumeStatus* SDLComponentVolumeStatus_NORMAL = nil; +SDLComponentVolumeStatus* SDLComponentVolumeStatus_LOW = nil; +SDLComponentVolumeStatus* SDLComponentVolumeStatus_FAULT = nil; +SDLComponentVolumeStatus* SDLComponentVolumeStatus_ALERT = nil; +SDLComponentVolumeStatus* SDLComponentVolumeStatus_NOT_SUPPORTED = nil; + +NSMutableArray* SDLComponentVolumeStatus_values = nil; + +@implementation SDLComponentVolumeStatus + ++(SDLComponentVolumeStatus*) valueOf:(NSString*) value { + for (SDLComponentVolumeStatus* item in SDLComponentVolumeStatus.values) { + if ([item.value isEqualToString:value]) { + return item; + } + } + return nil; +} + ++(NSMutableArray*) values { + if (SDLComponentVolumeStatus_values == nil) { + SDLComponentVolumeStatus_values = [[NSMutableArray alloc] initWithObjects: + SDLComponentVolumeStatus.UNKNOWN, + SDLComponentVolumeStatus.NORMAL, + SDLComponentVolumeStatus.LOW, + SDLComponentVolumeStatus.FAULT, + SDLComponentVolumeStatus.ALERT, + SDLComponentVolumeStatus.NOT_SUPPORTED, + nil]; + } + return SDLComponentVolumeStatus_values; +} + ++(SDLComponentVolumeStatus*) UNKNOWN { + if (SDLComponentVolumeStatus_UNKNOWN == nil) { + SDLComponentVolumeStatus_UNKNOWN = [[SDLComponentVolumeStatus alloc] initWithValue:@"UNKNOWN"]; + } + return SDLComponentVolumeStatus_UNKNOWN; +} + ++(SDLComponentVolumeStatus*) NORMAL { + if (SDLComponentVolumeStatus_NORMAL == nil) { + SDLComponentVolumeStatus_NORMAL = [[SDLComponentVolumeStatus alloc] initWithValue:@"NORMAL"]; + } + return SDLComponentVolumeStatus_NORMAL; +} + ++(SDLComponentVolumeStatus*) LOW { + if (SDLComponentVolumeStatus_LOW == nil) { + SDLComponentVolumeStatus_LOW = [[SDLComponentVolumeStatus alloc] initWithValue:@"LOW"]; + } + return SDLComponentVolumeStatus_LOW; +} + ++(SDLComponentVolumeStatus*) FAULT { + if (SDLComponentVolumeStatus_FAULT == nil) { + SDLComponentVolumeStatus_FAULT = [[SDLComponentVolumeStatus alloc] initWithValue:@"FAULT"]; + } + return SDLComponentVolumeStatus_FAULT; +} + ++(SDLComponentVolumeStatus*) ALERT { + if (SDLComponentVolumeStatus_ALERT == nil) { + SDLComponentVolumeStatus_ALERT = [[SDLComponentVolumeStatus alloc] initWithValue:@"ALERT"]; + } + return SDLComponentVolumeStatus_ALERT; +} + ++(SDLComponentVolumeStatus*) NOT_SUPPORTED { + if (SDLComponentVolumeStatus_NOT_SUPPORTED == nil) { + SDLComponentVolumeStatus_NOT_SUPPORTED = [[SDLComponentVolumeStatus alloc] initWithValue:@"NOT_SUPPORTED"]; + } + return SDLComponentVolumeStatus_NOT_SUPPORTED; +} + +@end |