diff options
author | Mihail Vyrko <mvyrko@qulix.com> | 2019-03-20 14:32:34 +0300 |
---|---|---|
committer | Mihail Vyrko <mvyrko@qulix.com> | 2019-03-20 14:32:34 +0300 |
commit | f9002ef9e158a7c0dd84e204345af83517a27361 (patch) | |
tree | fa4e3bc7b93d022c002d8a4e647a40593b22c7d1 /SmartDeviceLink | |
parent | 48278d6ffa6dfea71f11a3dddb10f773fe56ba47 (diff) | |
download | sdl_ios-f9002ef9e158a7c0dd84e204345af83517a27361.tar.gz |
verify type of returned objects
Diffstat (limited to 'SmartDeviceLink')
179 files changed, 1130 insertions, 775 deletions
diff --git a/SmartDeviceLink/NSMutableDictionary+Store.h b/SmartDeviceLink/NSMutableDictionary+Store.h index 3f09d9296..b43ce8e3c 100644 --- a/SmartDeviceLink/NSMutableDictionary+Store.h +++ b/SmartDeviceLink/NSMutableDictionary+Store.h @@ -18,9 +18,35 @@ typedef NSString* SDLEnum SDL_SWIFT_ENUM; @interface NSDictionary (Store) - (void)sdl_setObject:(NSObject *)object forName:(SDLRPCParameterName)name; -- (nullable id)sdl_objectForName:(SDLRPCParameterName)name; + +- (nullable SDLEnum)sdl_enumForName:(SDLRPCParameterName)name error:(NSError **)error; +- (nullable NSArray<SDLRPCParameterName> *)sdl_enumsForName:(SDLRPCParameterName)name error:(NSError **)error; + +/** + * @return object of classType or nil + */ - (nullable id)sdl_objectForName:(SDLRPCParameterName)name ofClass:(Class)classType; -- (NSArray *)sdl_objectsForName:(SDLRPCParameterName)name ofClass:(Class)classType; + +/** + * @return array of classType objects or nil +*/ +- (nullable NSArray *)sdl_objectsForName:(SDLRPCParameterName)name ofClass:(Class)classType; + +/** + * @param classType expected class of returned object + * @param error if stored value isn't classType + * @warning returned object can be not of classType + * @return object of classType overwise error would be filled +*/ +- (nullable id)sdl_objectForName:(SDLRPCParameterName)name ofClass:(Class)classType error:(NSError **)error; + +/** + * @param classType expected class of array objects + * @param error if array objects value isn't classType or stored objects aren't array + * @warning returned object can be not array or stored objects aren't of classType + * @return try to return array of classType objects overwise error would be filled +*/ +- (nullable NSArray *)sdl_objectsForName:(SDLRPCParameterName)name ofClass:(Class)classType error:(NSError **)error; @end diff --git a/SmartDeviceLink/NSMutableDictionary+Store.m b/SmartDeviceLink/NSMutableDictionary+Store.m index 990db398d..23b2cc790 100644 --- a/SmartDeviceLink/NSMutableDictionary+Store.m +++ b/SmartDeviceLink/NSMutableDictionary+Store.m @@ -7,6 +7,8 @@ // #import "NSMutableDictionary+Store.h" +#import "SDLRPCStruct.h" +#import "SDLError.h" NS_ASSUME_NONNULL_BEGIN @@ -24,32 +26,88 @@ NS_ASSUME_NONNULL_BEGIN return self[name]; } +#pragma mark - enum + +- (nullable SDLRPCParameterName)sdl_enumForName:(SDLRPCParameterName)name error:(NSError * _Nullable __autoreleasing * _Nullable)error { + return [self sdl_objectForName:name ofClass:NSString.class error:error]; +} + +#pragma mark - enums + +- (nullable NSArray<SDLRPCParameterName> *)sdl_enumsForName:(SDLRPCParameterName)name error:(NSError * _Nullable __autoreleasing * _Nullable)error { + return [self sdl_objectsForName:name ofClass:NSString.class error:error]; +} + +#pragma mark - object + - (nullable id)sdl_objectForName:(SDLRPCParameterName)name ofClass:(Class)classType { - NSObject *obj = [self sdl_objectForName:name]; + NSError *error; + id object = [self sdl_objectForName:name ofClass:classType error:&error]; + return error == nil ? object : nil; +} + +- (nullable id)sdl_objectForName:(SDLRPCParameterName)name ofClass:(Class)classType error:(NSError * _Nullable __autoreleasing * _Nullable)error { + id obj = [self sdl_objectForName:name]; + if (obj == nil || [obj isKindOfClass:classType]) { return obj; - } else { - return [[classType alloc] initWithDictionary:(NSDictionary *)obj]; } + // translate dictionaries to objects + if ([obj isKindOfClass:NSDictionary.class] && [classType instancesRespondToSelector:@selector(initWithDictionary:)]) { + obj = [[classType alloc] initWithDictionary:(NSDictionary *)obj]; + // update store so that the object isn't created multiple times + [self sdl_setObject:obj forName:name]; + return obj; + } + NSError *wrongObjectError = [NSError sdl_store_wrongObject:obj expectedType:classType]; + + NSAssert(NO, [[wrongObjectError userInfo] objectForKey:NSLocalizedFailureReasonErrorKey]); + + if (error) { + *error = wrongObjectError; + } + + return nil; } -- (NSArray *)sdl_objectsForName:(SDLRPCParameterName)name ofClass:(Class)classType { - NSArray *array = [self sdl_objectForName:name]; - if ([array isEqual:[NSNull null]]) { - return [NSMutableArray array]; - } else if (array.count < 1 || [array.firstObject isMemberOfClass:classType]) { +#pragma mark - objects + +- (nullable NSArray *)sdl_objectsForName:(SDLRPCParameterName)name ofClass:(Class)classType { + NSError *error; + id objects = [self sdl_objectsForName:name ofClass:classType error:&error]; + return error == nil ? objects : nil; +} + +- (nullable NSArray *)sdl_objectsForName:(SDLRPCParameterName)name ofClass:(Class)classType error:(NSError * _Nullable __autoreleasing * _Nullable)error { + NSArray *array = [self sdl_objectForName:name ofClass:NSArray.class error:error]; + if (!array || array.count < 1 || [array.firstObject isKindOfClass:classType]) { // It's an array of the actual class type, just return return array; - } else { + } + if ([classType instancesRespondToSelector:@selector(initWithDictionary:)]) { // It's an array of dictionaries, make them into their class type NSMutableArray *newList = [NSMutableArray arrayWithCapacity:array.count]; for (NSDictionary<NSString *, id> *dict in array) { - [newList addObject:[[classType alloc] initWithDictionary:dict]]; + if ([dict isKindOfClass:NSDictionary.class]) { + [newList addObject:[[classType alloc] initWithDictionary:dict]]; + } } return [newList copy]; } -} + NSError *wrongObjectError = nil; + if ([array isKindOfClass:NSArray.class] && ![array.firstObject isKindOfClass:classType]) { + wrongObjectError = [NSError sdl_store_wrongObject:array.firstObject expectedType:classType]; + } else { + wrongObjectError = [NSError sdl_store_wrongObject:array expectedType:NSArray.class]; + } + + NSAssert(NO, [wrongObjectError.userInfo objectForKey:NSLocalizedFailureReasonErrorKey]); + if (error) { + *error = wrongObjectError; + } + return nil; +} @end diff --git a/SmartDeviceLink/SDLAddCommand.m b/SmartDeviceLink/SDLAddCommand.m index f8c505a71..8da22b041 100644 --- a/SmartDeviceLink/SDLAddCommand.m +++ b/SmartDeviceLink/SDLAddCommand.m @@ -107,7 +107,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)cmdID { - return [parameters sdl_objectForName:SDLRPCParameterNameCommandId]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameCommandId ofClass:NSNumber.class error:&error]; } - (void)setMenuParams:(nullable SDLMenuParams *)menuParams { @@ -123,7 +124,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)vrCommands { - return [parameters sdl_objectForName:SDLRPCParameterNameVRCommands]; + return [parameters sdl_objectsForName:SDLRPCParameterNameVRCommands ofClass:NSString.class]; } - (void)setCmdIcon:(nullable SDLImage *)cmdIcon { diff --git a/SmartDeviceLink/SDLAddSubMenu.m b/SmartDeviceLink/SDLAddSubMenu.m index 75794e782..c57175ce7 100644 --- a/SmartDeviceLink/SDLAddSubMenu.m +++ b/SmartDeviceLink/SDLAddSubMenu.m @@ -48,7 +48,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)menuID { - return [parameters sdl_objectForName:SDLRPCParameterNameMenuId]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameMenuId ofClass:NSNumber.class error:&error]; } - (void)setPosition:(nullable NSNumber<SDLInt> *)position { @@ -56,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)position { - return [parameters sdl_objectForName:SDLRPCParameterNamePosition]; + return [parameters sdl_objectForName:SDLRPCParameterNamePosition ofClass:NSNumber.class]; } - (void)setMenuName:(NSString *)menuName { @@ -64,7 +65,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)menuName { - return [parameters sdl_objectForName:SDLRPCParameterNameMenuName]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameMenuName ofClass:NSString.class error:&error]; } - (void)setMenuIcon:(nullable SDLImage *)menuIcon { diff --git a/SmartDeviceLink/SDLAirbagStatus.m b/SmartDeviceLink/SDLAirbagStatus.m index d7839ea02..6ced889eb 100644 --- a/SmartDeviceLink/SDLAirbagStatus.m +++ b/SmartDeviceLink/SDLAirbagStatus.m @@ -14,7 +14,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)driverAirbagDeployed { - return [store sdl_objectForName:SDLRPCParameterNameDriverAirbagDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameDriverAirbagDeployed error:&error]; } - (void)setDriverSideAirbagDeployed:(SDLVehicleDataEventStatus)driverSideAirbagDeployed { @@ -22,7 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)driverSideAirbagDeployed { - return [store sdl_objectForName:SDLRPCParameterNameDriverSideAirbagDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameDriverSideAirbagDeployed error:&error]; } - (void)setDriverCurtainAirbagDeployed:(SDLVehicleDataEventStatus)driverCurtainAirbagDeployed { @@ -30,14 +32,16 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)driverCurtainAirbagDeployed { - return [store sdl_objectForName:SDLRPCParameterNameDriverCurtainAirbagDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameDriverCurtainAirbagDeployed error:&error]; } - (void)setPassengerAirbagDeployed:(SDLVehicleDataEventStatus)passengerAirbagDeployed { [store sdl_setObject:passengerAirbagDeployed forName:SDLRPCParameterNamePassengerAirbagDeployed];} - (SDLVehicleDataEventStatus)passengerAirbagDeployed { - return [store sdl_objectForName:SDLRPCParameterNamePassengerAirbagDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePassengerAirbagDeployed error:&error]; } - (void)setPassengerCurtainAirbagDeployed:(SDLVehicleDataEventStatus)passengerCurtainAirbagDeployed { @@ -45,7 +49,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)passengerCurtainAirbagDeployed { - return [store sdl_objectForName:SDLRPCParameterNamePassengerCurtainAirbagDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePassengerCurtainAirbagDeployed error:&error]; } - (void)setDriverKneeAirbagDeployed:(SDLVehicleDataEventStatus)driverKneeAirbagDeployed { @@ -53,7 +58,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)driverKneeAirbagDeployed { - return [store sdl_objectForName:SDLRPCParameterNameDriverKneeAirbagDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameDriverKneeAirbagDeployed error:&error]; } - (void)setPassengerSideAirbagDeployed:(SDLVehicleDataEventStatus)passengerSideAirbagDeployed { @@ -61,7 +67,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)passengerSideAirbagDeployed { - return [store sdl_objectForName:SDLRPCParameterNamePassengerSideAirbagDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePassengerSideAirbagDeployed error:&error]; } - (void)setPassengerKneeAirbagDeployed:(SDLVehicleDataEventStatus)passengerKneeAirbagDeployed { @@ -69,7 +76,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)passengerKneeAirbagDeployed { - return [store sdl_objectForName:SDLRPCParameterNamePassengerKneeAirbagDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePassengerKneeAirbagDeployed error:&error]; } @end diff --git a/SmartDeviceLink/SDLAlert.m b/SmartDeviceLink/SDLAlert.m index 363061694..b5bff1378 100644 --- a/SmartDeviceLink/SDLAlert.m +++ b/SmartDeviceLink/SDLAlert.m @@ -79,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)alertText1 { - return [parameters sdl_objectForName:SDLRPCParameterNameAlertText1]; + return [parameters sdl_objectForName:SDLRPCParameterNameAlertText1 ofClass:NSString.class]; } - (void)setAlertText2:(nullable NSString *)alertText2 { @@ -87,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)alertText2 { - return [parameters sdl_objectForName:SDLRPCParameterNameAlertText2]; + return [parameters sdl_objectForName:SDLRPCParameterNameAlertText2 ofClass:NSString.class]; } - (void)setAlertText3:(nullable NSString *)alertText3 { @@ -95,7 +95,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)alertText3 { - return [parameters sdl_objectForName:SDLRPCParameterNameAlertText3]; + return [parameters sdl_objectForName:SDLRPCParameterNameAlertText3 ofClass:NSString.class]; } - (void)setTtsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks { @@ -111,7 +111,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)duration { - return [parameters sdl_objectForName:SDLRPCParameterNameDuration]; + return [parameters sdl_objectForName:SDLRPCParameterNameDuration ofClass:NSNumber.class]; } - (void)setPlayTone:(nullable NSNumber<SDLBool> *)playTone { @@ -119,7 +119,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)playTone { - return [parameters sdl_objectForName:SDLRPCParameterNamePlayTone]; + return [parameters sdl_objectForName:SDLRPCParameterNamePlayTone ofClass:NSNumber.class]; } - (void)setProgressIndicator:(nullable NSNumber<SDLBool> *)progressIndicator { @@ -127,7 +127,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)progressIndicator { - return [parameters sdl_objectForName:SDLRPCParameterNameProgressIndicator]; + return [parameters sdl_objectForName:SDLRPCParameterNameProgressIndicator ofClass:NSNumber.class]; } - (void)setSoftButtons:(nullable NSArray<SDLSoftButton *> *)softButtons { diff --git a/SmartDeviceLink/SDLAlertResponse.m b/SmartDeviceLink/SDLAlertResponse.m index 67bdb20e3..dd77c2780 100644 --- a/SmartDeviceLink/SDLAlertResponse.m +++ b/SmartDeviceLink/SDLAlertResponse.m @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN [parameters sdl_setObject:tryAgainTime forName:SDLRPCParameterNameTryAgainTime];} - (nullable NSNumber<SDLInt> *)tryAgainTime { - return [parameters sdl_objectForName:SDLRPCParameterNameTryAgainTime]; + return [parameters sdl_objectForName:SDLRPCParameterNameTryAgainTime ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLAppInfo.m b/SmartDeviceLink/SDLAppInfo.m index 4f9694564..73d622ff9 100644 --- a/SmartDeviceLink/SDLAppInfo.m +++ b/SmartDeviceLink/SDLAppInfo.m @@ -31,7 +31,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)appDisplayName { - return [store sdl_objectForName:SDLRPCParameterNameAppDisplayName]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameAppDisplayName ofClass:NSString.class error:&error]; } - (void)setAppBundleID:(NSString *)appBundleID { @@ -39,7 +40,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)appBundleID { - return [store sdl_objectForName:SDLRPCParameterNameAppBundleId]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameAppBundleId ofClass:NSString.class error:&error]; } - (void)setAppVersion:(NSString *)appVersion { @@ -47,7 +49,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)appVersion { - return [store sdl_objectForName:SDLRPCParameterNameAppVersion]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameAppVersion ofClass:NSString.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLAppServiceCapability.m b/SmartDeviceLink/SDLAppServiceCapability.m index 9361b1b09..94df91636 100644 --- a/SmartDeviceLink/SDLAppServiceCapability.m +++ b/SmartDeviceLink/SDLAppServiceCapability.m @@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLServiceUpdateReason)updateReason { - return [store sdl_objectForName:SDLRPCParameterNameUpdateReason]; + return [store sdl_enumForName:SDLRPCParameterNameUpdateReason error:nil]; } - (void)setUpdatedAppServiceRecord:(SDLAppServiceRecord *)updatedAppServiceRecord { diff --git a/SmartDeviceLink/SDLAppServiceData.m b/SmartDeviceLink/SDLAppServiceData.m index 8453278ff..9b19a3505 100644 --- a/SmartDeviceLink/SDLAppServiceData.m +++ b/SmartDeviceLink/SDLAppServiceData.m @@ -86,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)serviceType { - return [store sdl_objectForName:SDLRPCParameterNameServiceType]; + return [store sdl_objectForName:SDLRPCParameterNameServiceType ofClass:NSString.class]; } - (void)setServiceId:(NSString *)serviceId { @@ -94,7 +94,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)serviceId { - return [store sdl_objectForName:SDLRPCParameterNameServiceID]; + return [store sdl_objectForName:SDLRPCParameterNameServiceID ofClass:NSString.class]; } - (void)setWeatherServiceData:(nullable SDLWeatherServiceData *)weatherServiceData { diff --git a/SmartDeviceLink/SDLAppServiceManifest.m b/SmartDeviceLink/SDLAppServiceManifest.m index a92470c36..b6ded0df2 100644 --- a/SmartDeviceLink/SDLAppServiceManifest.m +++ b/SmartDeviceLink/SDLAppServiceManifest.m @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)serviceName { - return [store sdl_objectForName:SDLRPCParameterNameServiceName]; + return [store sdl_objectForName:SDLRPCParameterNameServiceName ofClass:NSString.class]; } - (void)setServiceType:(NSString *)serviceType { @@ -79,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)serviceType { - return [store sdl_objectForName:SDLRPCParameterNameServiceType]; + return [store sdl_objectForName:SDLRPCParameterNameServiceType ofClass:NSString.class]; } - (void)setServiceIcon:(nullable SDLImage *)serviceIcon { @@ -95,7 +95,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)allowAppConsumers { - return [store sdl_objectForName:SDLRPCParameterNameAllowAppConsumers]; + return [store sdl_objectForName:SDLRPCParameterNameAllowAppConsumers ofClass:NSNumber.class]; } - (void)setRpcSpecVersion:(nullable SDLSyncMsgVersion *)rpcSpecVersion { @@ -111,7 +111,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSNumber<SDLInt> *> *)handledRPCs { - return [store sdl_objectForName:SDLRPCParameterNameHandledRPCs]; + return [store sdl_objectsForName:SDLRPCParameterNameHandledRPCs ofClass:NSNumber.class]; } - (void)setWeatherServiceManifest:(nullable SDLWeatherServiceManifest *)weatherServiceManifest { diff --git a/SmartDeviceLink/SDLAppServiceRecord.m b/SmartDeviceLink/SDLAppServiceRecord.m index 7f60afdc1..4ca0e3a2c 100644 --- a/SmartDeviceLink/SDLAppServiceRecord.m +++ b/SmartDeviceLink/SDLAppServiceRecord.m @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)serviceID { - return [store sdl_objectForName:SDLRPCParameterNameServiceID]; + return [store sdl_objectForName:SDLRPCParameterNameServiceID ofClass:NSString.class]; } - (void)setServiceManifest:(SDLAppServiceManifest *)serviceManifest { @@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)servicePublished { - return [store sdl_objectForName:SDLRPCParameterNameServicePublished]; + return [store sdl_objectForName:SDLRPCParameterNameServicePublished ofClass:NSNumber.class]; } - (void)setServiceActive:(NSNumber<SDLBool> *)serviceActive { @@ -59,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)serviceActive { - return [store sdl_objectForName:SDLRPCParameterNameServiceActive]; + return [store sdl_objectForName:SDLRPCParameterNameServiceActive ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.m b/SmartDeviceLink/SDLAudioControlCapabilities.m index df845666d..f1939ea69 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.m +++ b/SmartDeviceLink/SDLAudioControlCapabilities.m @@ -39,7 +39,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)moduleName { - return [store sdl_objectForName:SDLRPCParameterNameModuleName]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameModuleName ofClass:NSString.class error:&error]; } - (void)setSourceAvailable:(nullable NSNumber<SDLBool> *)sourceAvailable { @@ -47,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)sourceAvailable { - return [store sdl_objectForName:SDLRPCParameterNameSourceAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameSourceAvailable ofClass:NSNumber.class]; } - (void)setKeepContextAvailable:(nullable NSNumber<SDLBool> *)keepContextAvailable { @@ -55,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)keepContextAvailable { - return [store sdl_objectForName:SDLRPCParameterNameKeepContextAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameKeepContextAvailable ofClass:NSNumber.class]; } - (void)setVolumeAvailable:(nullable NSNumber<SDLBool> *)volumeAvailable { @@ -63,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)volumeAvailable { - return [store sdl_objectForName:SDLRPCParameterNameVolumeAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameVolumeAvailable ofClass:NSNumber.class]; } - (void)setEqualizerAvailable:(nullable NSNumber<SDLBool> *)equalizerAvailable { @@ -71,7 +72,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)equalizerAvailable { - return [store sdl_objectForName:SDLRPCParameterNameEqualizerAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameEqualizerAvailable ofClass:NSNumber.class]; } - (void)setEqualizerMaxChannelId:(nullable NSNumber<SDLInt> *)equalizerMaxChannelId { @@ -79,7 +80,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)equalizerMaxChannelId { - return [store sdl_objectForName:SDLRPCParameterNameEqualizerMaxChannelId]; + return [store sdl_objectForName:SDLRPCParameterNameEqualizerMaxChannelId ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLAudioControlData.m b/SmartDeviceLink/SDLAudioControlData.m index e6737a290..f6e1841a9 100644 --- a/SmartDeviceLink/SDLAudioControlData.m +++ b/SmartDeviceLink/SDLAudioControlData.m @@ -4,6 +4,7 @@ #import "SDLAudioControlData.h" #import "SDLRPCParameterNames.h" #import "NSMutableDictionary+Store.h" +#import "SDLEqualizerSettings.h" NS_ASSUME_NONNULL_BEGIN @@ -29,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLPrimaryAudioSource)source { - return [store sdl_objectForName:SDLRPCParameterNameSource]; + return [store sdl_enumForName:SDLRPCParameterNameSource error:nil]; } - (void)setKeepContext:(nullable NSNumber<SDLBool> *)keepContext { @@ -37,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)keepContext { - return [store sdl_objectForName:SDLRPCParameterNameKeepContext]; + return [store sdl_objectForName:SDLRPCParameterNameKeepContext ofClass:NSNumber.class]; } - (void)setVolume:(nullable NSNumber<SDLInt> *)volume { @@ -45,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)volume { - return [store sdl_objectForName:SDLRPCParameterNameVolume]; + return [store sdl_objectForName:SDLRPCParameterNameVolume ofClass:NSNumber.class]; } - (void)setEqualizerSettings:(nullable NSArray<SDLEqualizerSettings *> *)equalizerSettings { @@ -53,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLEqualizerSettings *> *)equalizerSettings { - return [store sdl_objectForName:SDLRPCParameterNameEqualizerSettings]; + return [store sdl_objectsForName:SDLRPCParameterNameEqualizerSettings ofClass:SDLEqualizerSettings.class]; } @end diff --git a/SmartDeviceLink/SDLAudioPassThruCapabilities.m b/SmartDeviceLink/SDLAudioPassThruCapabilities.m index 0a3232c27..87c4e6473 100644 --- a/SmartDeviceLink/SDLAudioPassThruCapabilities.m +++ b/SmartDeviceLink/SDLAudioPassThruCapabilities.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSamplingRate)samplingRate { - return [store sdl_objectForName:SDLRPCParameterNameSamplingRate]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameSamplingRate error:&error]; } - (void)setBitsPerSample:(SDLBitsPerSample)bitsPerSample { @@ -24,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLBitsPerSample)bitsPerSample { - return [store sdl_objectForName:SDLRPCParameterNameBitsPerSample]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameBitsPerSample error:&error]; } - (void)setAudioType:(SDLAudioType)audioType { @@ -32,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLAudioType)audioType { - return [store sdl_objectForName:SDLRPCParameterNameAudioType]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameAudioType error:&error]; } @end diff --git a/SmartDeviceLink/SDLBeltStatus.m b/SmartDeviceLink/SDLBeltStatus.m index be3afc858..eae7c8954 100644 --- a/SmartDeviceLink/SDLBeltStatus.m +++ b/SmartDeviceLink/SDLBeltStatus.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)driverBeltDeployed { - return [store sdl_objectForName:SDLRPCParameterNameDriverBeltDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameDriverBeltDeployed error:&error]; } - (void)setPassengerBeltDeployed:(SDLVehicleDataEventStatus)passengerBeltDeployed { @@ -24,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)passengerBeltDeployed { - return [store sdl_objectForName:SDLRPCParameterNamePassengerBeltDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePassengerBeltDeployed error:&error]; } - (void)setPassengerBuckleBelted:(SDLVehicleDataEventStatus)passengerBuckleBelted { @@ -32,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)passengerBuckleBelted { - return [store sdl_objectForName:SDLRPCParameterNamePassengerBuckleBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePassengerBuckleBelted error:&error]; } - (void)setDriverBuckleBelted:(SDLVehicleDataEventStatus)driverBuckleBelted { @@ -40,7 +43,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)driverBuckleBelted { - return [store sdl_objectForName:SDLRPCParameterNameDriverBuckleBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameDriverBuckleBelted error:&error]; } - (void)setLeftRow2BuckleBelted:(SDLVehicleDataEventStatus)leftRow2BuckleBelted { @@ -48,7 +52,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)leftRow2BuckleBelted { - return [store sdl_objectForName:SDLRPCParameterNameLeftRow2BuckleBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameLeftRow2BuckleBelted error:&error]; } - (void)setPassengerChildDetected:(SDLVehicleDataEventStatus)passengerChildDetected { @@ -56,7 +61,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)passengerChildDetected { - return [store sdl_objectForName:SDLRPCParameterNamePassengerChildDetected]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePassengerChildDetected error:&error]; } - (void)setRightRow2BuckleBelted:(SDLVehicleDataEventStatus)rightRow2BuckleBelted { @@ -64,7 +70,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)rightRow2BuckleBelted { - return [store sdl_objectForName:SDLRPCParameterNameRightRow2BuckleBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameRightRow2BuckleBelted error:&error]; } - (void)setMiddleRow2BuckleBelted:(SDLVehicleDataEventStatus)middleRow2BuckleBelted { @@ -72,7 +79,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)middleRow2BuckleBelted { - return [store sdl_objectForName:SDLRPCParameterNameMiddleRow2BuckleBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameMiddleRow2BuckleBelted error:&error]; } - (void)setMiddleRow3BuckleBelted:(SDLVehicleDataEventStatus)middleRow3BuckleBelted { @@ -80,7 +88,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)middleRow3BuckleBelted { - return [store sdl_objectForName:SDLRPCParameterNameMiddleRow3BuckleBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameMiddleRow3BuckleBelted error:&error]; } - (void)setLeftRow3BuckleBelted:(SDLVehicleDataEventStatus)leftRow3BuckleBelted { @@ -88,7 +97,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)leftRow3BuckleBelted { - return [store sdl_objectForName:SDLRPCParameterNameLeftRow3BuckleBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameLeftRow3BuckleBelted error:&error]; } - (void)setRightRow3BuckleBelted:(SDLVehicleDataEventStatus)rightRow3BuckleBelted { @@ -96,7 +106,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)rightRow3BuckleBelted { - return [store sdl_objectForName:SDLRPCParameterNameRightRow3BuckleBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameRightRow3BuckleBelted error:&error]; } - (void)setLeftRearInflatableBelted:(SDLVehicleDataEventStatus)leftRearInflatableBelted { @@ -104,7 +115,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)leftRearInflatableBelted { - return [store sdl_objectForName:SDLRPCParameterNameLeftRearInflatableBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameLeftRearInflatableBelted error:&error]; } - (void)setRightRearInflatableBelted:(SDLVehicleDataEventStatus)rightRearInflatableBelted { @@ -112,7 +124,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)rightRearInflatableBelted { - return [store sdl_objectForName:SDLRPCParameterNameRightRearInflatableBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameRightRearInflatableBelted error:&error]; } - (void)setMiddleRow1BeltDeployed:(SDLVehicleDataEventStatus)middleRow1BeltDeployed { @@ -120,7 +133,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)middleRow1BeltDeployed { - return [store sdl_objectForName:SDLRPCParameterNameMiddleRow1BeltDeployed]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameMiddleRow1BeltDeployed error:&error]; } - (void)setMiddleRow1BuckleBelted:(SDLVehicleDataEventStatus)middleRow1BuckleBelted { @@ -128,7 +142,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)middleRow1BuckleBelted { - return [store sdl_objectForName:SDLRPCParameterNameMiddleRow1BuckleBelted]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameMiddleRow1BuckleBelted error:&error]; } @end diff --git a/SmartDeviceLink/SDLBodyInformation.m b/SmartDeviceLink/SDLBodyInformation.m index bd276a32e..e7360cb0b 100644 --- a/SmartDeviceLink/SDLBodyInformation.m +++ b/SmartDeviceLink/SDLBodyInformation.m @@ -18,7 +18,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)parkBrakeActive { - return [store sdl_objectForName:SDLRPCParameterNameParkBrakeActive]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameParkBrakeActive ofClass:NSNumber.class error:&error]; } - (void)setIgnitionStableStatus:(SDLIgnitionStableStatus)ignitionStableStatus { @@ -26,7 +27,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLIgnitionStableStatus)ignitionStableStatus { - return [store sdl_objectForName:SDLRPCParameterNameIgnitionStableStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameIgnitionStableStatus error:&error]; } - (void)setIgnitionStatus:(SDLIgnitionStatus)ignitionStatus { @@ -34,7 +36,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLIgnitionStatus)ignitionStatus { - return [store sdl_objectForName:SDLRPCParameterNameIgnitionStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameIgnitionStatus error:&error]; } - (void)setDriverDoorAjar:(nullable NSNumber<SDLBool> *)driverDoorAjar { @@ -42,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)driverDoorAjar { - return [store sdl_objectForName:SDLRPCParameterNameDriverDoorAjar]; + return [store sdl_objectForName:SDLRPCParameterNameDriverDoorAjar ofClass:NSNumber.class]; } - (void)setPassengerDoorAjar:(nullable NSNumber<SDLBool> *)passengerDoorAjar { @@ -50,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)passengerDoorAjar { - return [store sdl_objectForName:SDLRPCParameterNamePassengerDoorAjar]; + return [store sdl_objectForName:SDLRPCParameterNamePassengerDoorAjar ofClass:NSNumber.class]; } - (void)setRearLeftDoorAjar:(nullable NSNumber<SDLBool> *)rearLeftDoorAjar { @@ -58,7 +61,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)rearLeftDoorAjar { - return [store sdl_objectForName:SDLRPCParameterNameRearLeftDoorAjar]; + return [store sdl_objectForName:SDLRPCParameterNameRearLeftDoorAjar ofClass:NSNumber.class]; } - (void)setRearRightDoorAjar:(nullable NSNumber<SDLBool> *)rearRightDoorAjar { @@ -66,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)rearRightDoorAjar { - return [store sdl_objectForName:SDLRPCParameterNameRearRightDoorAjar]; + return [store sdl_objectForName:SDLRPCParameterNameRearRightDoorAjar ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLButtonCapabilities.m b/SmartDeviceLink/SDLButtonCapabilities.m index cf3e7d2e0..332bafc49 100644 --- a/SmartDeviceLink/SDLButtonCapabilities.m +++ b/SmartDeviceLink/SDLButtonCapabilities.m @@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLButtonName)name { - return [store sdl_objectForName:SDLRPCParameterNameName]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameName error:&error]; } - (void)setShortPressAvailable:(NSNumber<SDLBool> *)shortPressAvailable { @@ -23,7 +24,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)shortPressAvailable { - return [store sdl_objectForName:SDLRPCParameterNameShortPressAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameShortPressAvailable ofClass:NSNumber.class error:&error]; } - (void)setLongPressAvailable:(NSNumber<SDLBool> *)longPressAvailable { @@ -31,7 +33,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)longPressAvailable { - return [store sdl_objectForName:SDLRPCParameterNameLongPressAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameLongPressAvailable ofClass:NSNumber.class error:&error]; } - (void)setUpDownAvailable:(NSNumber<SDLBool> *)upDownAvailable { @@ -39,7 +42,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)upDownAvailable { - return [store sdl_objectForName:SDLRPCParameterNameUpDownAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameUpDownAvailable ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLButtonPress.m b/SmartDeviceLink/SDLButtonPress.m index c0ff1a058..0b3bbe78b 100644 --- a/SmartDeviceLink/SDLButtonPress.m +++ b/SmartDeviceLink/SDLButtonPress.m @@ -34,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLModuleType)moduleType { - return [parameters sdl_objectForName:SDLRPCParameterNameModuleType]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameModuleType error:&error]; } - (void)setButtonName:(SDLButtonName)buttonName { @@ -42,7 +43,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLButtonName)buttonName { - return [parameters sdl_objectForName:SDLRPCParameterNameButtonName]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameButtonName error:&error]; } - (void)setButtonPressMode:(SDLButtonPressMode)buttonPressMode { @@ -50,7 +52,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLButtonPressMode)buttonPressMode { - return [parameters sdl_objectForName:SDLRPCParameterNameButtonPressMode]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameButtonPressMode error:&error]; } @end diff --git a/SmartDeviceLink/SDLChangeRegistration.m b/SmartDeviceLink/SDLChangeRegistration.m index 64a7024c5..bc975f6ee 100644 --- a/SmartDeviceLink/SDLChangeRegistration.m +++ b/SmartDeviceLink/SDLChangeRegistration.m @@ -49,7 +49,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLLanguage)language { - return [parameters sdl_objectForName:SDLRPCParameterNameLanguage]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameLanguage error:&error]; } - (void)setHmiDisplayLanguage:(SDLLanguage )hmiDisplayLanguage { @@ -57,7 +58,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLLanguage)hmiDisplayLanguage { - return [parameters sdl_objectForName:SDLRPCParameterNameHMIDisplayLanguage]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameHMIDisplayLanguage error:&error]; } - (void)setAppName:(nullable NSString *)appName { @@ -65,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)appName { - return [[parameters sdl_objectForName:SDLRPCParameterNameAppName] copy]; + return [[parameters sdl_objectForName:SDLRPCParameterNameAppName ofClass:NSString.class] copy]; } - (void)setTtsName:(nullable NSArray<SDLTTSChunk *> *)ttsName { @@ -81,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)ngnMediaScreenAppName { - return [parameters sdl_objectForName:SDLRPCParameterNameNGNMediaScreenAppName]; + return [parameters sdl_objectForName:SDLRPCParameterNameNGNMediaScreenAppName ofClass:NSString.class]; } - (void)setVrSynonyms:(nullable NSArray<NSString *> *)vrSynonyms { @@ -89,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)vrSynonyms { - return [parameters sdl_objectForName:SDLRPCParameterNameVRSynonyms]; + return [parameters sdl_objectsForName:SDLRPCParameterNameVRSynonyms ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLChoice.m b/SmartDeviceLink/SDLChoice.m index 2417828d2..4a398191b 100644 --- a/SmartDeviceLink/SDLChoice.m +++ b/SmartDeviceLink/SDLChoice.m @@ -43,7 +43,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)choiceID { - return [store sdl_objectForName:SDLRPCParameterNameChoiceId]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameChoiceId ofClass:NSNumber.class error:&error]; } - (void)setMenuName:(NSString *)menuName { @@ -51,7 +52,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)menuName { - return [store sdl_objectForName:SDLRPCParameterNameMenuName]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameMenuName ofClass:NSString.class error:&error]; } - (void)setVrCommands:(nullable NSArray<NSString *> *)vrCommands { @@ -59,7 +61,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)vrCommands { - return [store sdl_objectForName:SDLRPCParameterNameVRCommands]; + return [store sdl_objectsForName:SDLRPCParameterNameVRCommands ofClass:NSString.class]; } - (void)setImage:(nullable SDLImage *)image { @@ -75,7 +77,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)secondaryText { - return [store sdl_objectForName:SDLRPCParameterNameSecondaryText]; + return [store sdl_objectForName:SDLRPCParameterNameSecondaryText ofClass:NSString.class]; } - (void)setTertiaryText:(nullable NSString *)tertiaryText { @@ -83,7 +85,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)tertiaryText { - return [store sdl_objectForName:SDLRPCParameterNameTertiaryText]; + return [store sdl_objectForName:SDLRPCParameterNameTertiaryText ofClass:NSString.class]; } - (void)setSecondaryImage:(nullable SDLImage *)secondaryImage { diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.m b/SmartDeviceLink/SDLClimateControlCapabilities.m index 25570ecbd..d36b1a88d 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.m +++ b/SmartDeviceLink/SDLClimateControlCapabilities.m @@ -43,7 +43,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)moduleName { - return [store sdl_objectForName:SDLRPCParameterNameModuleName]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameModuleName ofClass:NSString.class error:&error]; } - (void)setFanSpeedAvailable:(nullable NSNumber<SDLBool> *)fanSpeedAvailable { @@ -51,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fanSpeedAvailable { - return [store sdl_objectForName:SDLRPCParameterNameFanSpeedAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameFanSpeedAvailable ofClass:NSNumber.class]; } - (void)setDesiredTemperatureAvailable:(nullable NSNumber<SDLBool> *)desiredTemperatureAvailable { @@ -59,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)desiredTemperatureAvailable { - return [store sdl_objectForName:SDLRPCParameterNameDesiredTemperatureAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameDesiredTemperatureAvailable ofClass:NSNumber.class]; } - (void)setAcEnableAvailable:(nullable NSNumber<SDLBool> *)acEnableAvailable { @@ -67,7 +68,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)acEnableAvailable { - return [store sdl_objectForName:SDLRPCParameterNameACEnableAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameACEnableAvailable ofClass:NSNumber.class]; } - (void)setAcMaxEnableAvailable:(nullable NSNumber<SDLBool> *)acMaxEnableAvailable { @@ -75,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)acMaxEnableAvailable { - return [store sdl_objectForName:SDLRPCParameterNameACMaxEnableAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameACMaxEnableAvailable ofClass:NSNumber.class]; } - (void)setCirculateAirEnableAvailable:(nullable NSNumber<SDLBool> *)circulateAirEnableAvailable { @@ -83,7 +84,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)circulateAirEnableAvailable { - return [store sdl_objectForName:SDLRPCParameterNameCirculateAirEnableAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameCirculateAirEnableAvailable ofClass:NSNumber.class]; } - (void)setAutoModeEnableAvailable:(nullable NSNumber<SDLBool> *)autoModeEnableAvailable { @@ -91,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)autoModeEnableAvailable { - return [store sdl_objectForName:SDLRPCParameterNameAutoModeEnableAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameAutoModeEnableAvailable ofClass:NSNumber.class]; } - (void)setDualModeEnableAvailable:(nullable NSNumber<SDLBool> *)dualModeEnableAvailable { @@ -99,7 +100,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)dualModeEnableAvailable { - return [store sdl_objectForName:SDLRPCParameterNameDualModeEnableAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameDualModeEnableAvailable ofClass:NSNumber.class]; } - (void)setDefrostZoneAvailable:(nullable NSNumber<SDLBool> *)defrostZoneAvailable { @@ -107,7 +108,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)defrostZoneAvailable { - return [store sdl_objectForName:SDLRPCParameterNameDefrostZoneAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameDefrostZoneAvailable ofClass:NSNumber.class]; } - (void)setDefrostZone:(nullable NSArray <SDLDefrostZone>*)defrostZone { @@ -115,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLDefrostZone> *)defrostZone { - return [store sdl_objectForName:SDLRPCParameterNameDefrostZone]; + return [store sdl_enumsForName:SDLRPCParameterNameDefrostZone error:nil]; } - (void)setVentilationModeAvailable:(nullable NSNumber<SDLBool> *)ventilationModeAvailable { @@ -123,7 +124,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)ventilationModeAvailable { - return [store sdl_objectForName:SDLRPCParameterNameVentilationModeAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameVentilationModeAvailable ofClass:NSNumber.class]; } - (void)setVentilationMode:(nullable NSArray<SDLVentilationMode> *)ventilationMode { @@ -131,7 +132,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLVentilationMode> *)ventilationMode { - return [store sdl_objectForName:SDLRPCParameterNameVentilationMode]; + return [store sdl_enumsForName:SDLRPCParameterNameVentilationMode error:nil]; } - (void)setHeatedSteeringWheelAvailable:(nullable NSNumber<SDLBool> *)heatedSteeringWheelAvailable { @@ -139,7 +140,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatedSteeringWheelAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHeatedSteeringWheelAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHeatedSteeringWheelAvailable ofClass:NSNumber.class]; } - (void)setHeatedWindshieldAvailable:(nullable NSNumber<SDLBool> *)heatedWindshieldAvailable { @@ -147,7 +148,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatedWindshieldAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHeatedWindshieldAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHeatedWindshieldAvailable ofClass:NSNumber.class]; } - (void)setHeatedRearWindowAvailable:(nullable NSNumber<SDLBool> *)heatedRearWindowAvailable { @@ -155,7 +156,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatedRearWindowAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHeatedRearWindowAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHeatedRearWindowAvailable ofClass:NSNumber.class]; } - (void)setHeatedMirrorsAvailable:(nullable NSNumber<SDLBool> *)heatedMirrorsAvailable { @@ -163,7 +164,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatedMirrorsAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHeatedMirrorsAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHeatedMirrorsAvailable ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLClimateControlData.m b/SmartDeviceLink/SDLClimateControlData.m index f15e64e2d..bf5151759 100644 --- a/SmartDeviceLink/SDLClimateControlData.m +++ b/SmartDeviceLink/SDLClimateControlData.m @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)fanSpeed { - return [store sdl_objectForName:SDLRPCParameterNameFanSpeed]; + return [store sdl_objectForName:SDLRPCParameterNameFanSpeed ofClass:NSNumber.class]; } - (void)setCurrentTemperature:(nullable SDLTemperature *)currentTemperature { @@ -67,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)acEnable { - return [store sdl_objectForName:SDLRPCParameterNameACEnable]; + return [store sdl_objectForName:SDLRPCParameterNameACEnable ofClass:NSNumber.class]; } - (void)setCirculateAirEnable:(nullable NSNumber<SDLBool> *)circulateAirEnable { @@ -75,7 +75,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)circulateAirEnable { - return [store sdl_objectForName:SDLRPCParameterNameCirculateAirEnable]; + return [store sdl_objectForName:SDLRPCParameterNameCirculateAirEnable ofClass:NSNumber.class]; } - (void)setAutoModeEnable:(nullable NSNumber<SDLBool> *)autoModeEnable { @@ -83,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)autoModeEnable { - return [store sdl_objectForName:SDLRPCParameterNameAutoModeEnable]; + return [store sdl_objectForName:SDLRPCParameterNameAutoModeEnable ofClass:NSNumber.class]; } - (void)setDefrostZone:(nullable SDLDefrostZone)defrostZone { @@ -91,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLDefrostZone)defrostZone { - return [store sdl_objectForName:SDLRPCParameterNameDefrostZone]; + return [store sdl_enumForName:SDLRPCParameterNameDefrostZone error:nil]; } - (void)setDualModeEnable:(nullable NSNumber<SDLBool> *)dualModeEnable { @@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)dualModeEnable { - return [store sdl_objectForName:SDLRPCParameterNameDualModeEnable]; + return [store sdl_objectForName:SDLRPCParameterNameDualModeEnable ofClass:NSNumber.class]; } - (void)setAcMaxEnable:(nullable NSNumber<SDLBool> *)acMaxEnable { @@ -107,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)acMaxEnable { - return [store sdl_objectForName:SDLRPCParameterNameACMaxEnable]; + return [store sdl_objectForName:SDLRPCParameterNameACMaxEnable ofClass:NSNumber.class]; } - (void)setVentilationMode:(nullable SDLVentilationMode)ventilationMode { @@ -115,7 +115,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVentilationMode)ventilationMode { - return [store sdl_objectForName:SDLRPCParameterNameVentilationMode]; + return [store sdl_enumForName:SDLRPCParameterNameVentilationMode error:nil]; } - (void)setHeatedSteeringWheelEnable:(nullable NSNumber<SDLBool> *)heatedSteeringWheelEnable { @@ -123,7 +123,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatedSteeringWheelEnable { - return [store sdl_objectForName:SDLRPCParameterNameHeatedSteeringWheelEnable]; + return [store sdl_objectForName:SDLRPCParameterNameHeatedSteeringWheelEnable ofClass:NSNumber.class]; } - (void)setHeatedWindshieldEnable:(nullable NSNumber<SDLBool> *)heatedWindshieldEnable { @@ -131,7 +131,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatedWindshieldEnable { - return [store sdl_objectForName:SDLRPCParameterNameHeatedWindshieldEnable]; + return [store sdl_objectForName:SDLRPCParameterNameHeatedWindshieldEnable ofClass:NSNumber.class]; } - (void)setHeatedRearWindowEnable:(nullable NSNumber<SDLBool> *)heatedRearWindowEnable { @@ -139,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatedRearWindowEnable { - return [store sdl_objectForName:SDLRPCParameterNameHeatedRearWindowEnable]; + return [store sdl_objectForName:SDLRPCParameterNameHeatedRearWindowEnable ofClass:NSNumber.class]; } - (void)setHeatedMirrorsEnable:(nullable NSNumber<SDLBool> *)heatedMirrorsEnable { @@ -147,7 +147,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatedMirrorsEnable { - return [store sdl_objectForName:SDLRPCParameterNameHeatedMirrorsEnable]; + return [store sdl_objectForName:SDLRPCParameterNameHeatedMirrorsEnable ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLClusterModeStatus.m b/SmartDeviceLink/SDLClusterModeStatus.m index 57c15a4bc..4d37978e4 100644 --- a/SmartDeviceLink/SDLClusterModeStatus.m +++ b/SmartDeviceLink/SDLClusterModeStatus.m @@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)powerModeActive { - return [store sdl_objectForName:SDLRPCParameterNamePowerModeActive]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNamePowerModeActive ofClass:NSNumber.class error:&error]; } - (void)setPowerModeQualificationStatus:(SDLPowerModeQualificationStatus)powerModeQualificationStatus { @@ -23,7 +24,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLPowerModeQualificationStatus)powerModeQualificationStatus { - return [store sdl_objectForName:SDLRPCParameterNamePowerModeQualificationStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePowerModeQualificationStatus error:&error]; } - (void)setCarModeStatus:(SDLCarModeStatus)carModeStatus { @@ -31,7 +33,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLCarModeStatus)carModeStatus { - return [store sdl_objectForName:SDLRPCParameterNameCarModeStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameCarModeStatus error:&error]; } - (void)setPowerModeStatus:(SDLPowerModeStatus)powerModeStatus { @@ -39,7 +42,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLPowerModeStatus)powerModeStatus { - return [store sdl_objectForName:SDLRPCParameterNamePowerModeStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePowerModeStatus error:&error]; } @end diff --git a/SmartDeviceLink/SDLCreateInteractionChoiceSet.m b/SmartDeviceLink/SDLCreateInteractionChoiceSet.m index b21e9f271..06154fd9f 100644 --- a/SmartDeviceLink/SDLCreateInteractionChoiceSet.m +++ b/SmartDeviceLink/SDLCreateInteractionChoiceSet.m @@ -35,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)interactionChoiceSetID { - return [parameters sdl_objectForName:SDLRPCParameterNameInteractionChoiceSetId]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameInteractionChoiceSetId ofClass:NSNumber.class error:&error]; } - (void)setChoiceSet:(NSArray<SDLChoice *> *)choiceSet { @@ -43,7 +44,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLChoice *> *)choiceSet { - return [parameters sdl_objectsForName:SDLRPCParameterNameChoiceSet ofClass:SDLChoice.class]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameChoiceSet ofClass:SDLChoice.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLDIDResult.m b/SmartDeviceLink/SDLDIDResult.m index 62bf863b8..14d7fc73d 100644 --- a/SmartDeviceLink/SDLDIDResult.m +++ b/SmartDeviceLink/SDLDIDResult.m @@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataResultCode)resultCode { - return [store sdl_objectForName:SDLRPCParameterNameResultCode]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameResultCode error:&error]; } - (void)setDidLocation:(NSNumber<SDLInt> *)didLocation { @@ -23,7 +24,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)didLocation { - return [store sdl_objectForName:SDLRPCParameterNameDIDLocation]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameDIDLocation ofClass:NSNumber.class error:&error]; } - (void)setData:(nullable NSString *)data { @@ -31,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)data { - return [store sdl_objectForName:SDLRPCParameterNameData]; + return [store sdl_objectForName:SDLRPCParameterNameData ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLDateTime.m b/SmartDeviceLink/SDLDateTime.m index 8f9316082..cfd0bc223 100644 --- a/SmartDeviceLink/SDLDateTime.m +++ b/SmartDeviceLink/SDLDateTime.m @@ -63,7 +63,8 @@ } - (NSNumber<SDLInt> *)millisecond { - return [store sdl_objectForName:SDLRPCParameterNameMillisecond]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameMillisecond ofClass:NSNumber.class error:&error]; } - (void)setSecond:(NSNumber<SDLInt> *)second { @@ -71,7 +72,8 @@ } - (NSNumber<SDLInt> *)second { - return [store sdl_objectForName:SDLRPCParameterNameSecond]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameSecond ofClass:NSNumber.class error:&error]; } - (void)setMinute:(NSNumber<SDLInt> *)minute { @@ -79,7 +81,8 @@ } - (NSNumber<SDLInt> *)minute { - return [store sdl_objectForName:SDLRPCParameterNameMinute]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameMinute ofClass:NSNumber.class error:&error]; } - (void)setHour:(NSNumber<SDLInt> *)hour { @@ -87,7 +90,8 @@ } - (NSNumber<SDLInt> *)hour { - return [store sdl_objectForName:SDLRPCParameterNameHour]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameHour ofClass:NSNumber.class error:&error]; } - (void)setDay:(NSNumber<SDLInt> *)day { @@ -95,7 +99,8 @@ } - (NSNumber<SDLInt> *)day { - return [store sdl_objectForName:SDLRPCParameterNameDay]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameDay ofClass:NSNumber.class error:&error]; } - (void)setMonth:(NSNumber<SDLInt> *)month { @@ -103,7 +108,8 @@ } - (NSNumber<SDLInt> *)month { - return [store sdl_objectForName:SDLRPCParameterNameMonth]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameMonth ofClass:NSNumber.class error:&error]; } - (void)setYear:(NSNumber<SDLInt> *)year { @@ -111,7 +117,8 @@ } - (NSNumber<SDLInt> *)year { - return [store sdl_objectForName:SDLRPCParameterNameYear]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameYear ofClass:NSNumber.class error:&error]; } - (void)setTimezoneMinuteOffset:(NSNumber<SDLInt> *)timezoneMinuteOffset { @@ -119,7 +126,8 @@ } - (NSNumber<SDLInt> *)timezoneMinuteOffset { - return [store sdl_objectForName:SDLRPCParameterNameTimezoneMinuteOffset]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameTimezoneMinuteOffset ofClass:NSNumber.class error:&error]; } - (void)setTimezoneHourOffset:(NSNumber<SDLInt> *)timezoneHourOffset { @@ -127,7 +135,8 @@ } - (NSNumber<SDLInt> *)timezoneHourOffset { - return [store sdl_objectForName:SDLRPCParameterNameTimezoneHourOffset]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameTimezoneHourOffset ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLDeleteCommand.m b/SmartDeviceLink/SDLDeleteCommand.m index 2655213fa..dec3dd105 100644 --- a/SmartDeviceLink/SDLDeleteCommand.m +++ b/SmartDeviceLink/SDLDeleteCommand.m @@ -34,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)cmdID { - return [parameters sdl_objectForName:SDLRPCParameterNameCommandId]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameCommandId ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLDeleteFile.m b/SmartDeviceLink/SDLDeleteFile.m index 6f2197c44..bcd50bbd3 100644 --- a/SmartDeviceLink/SDLDeleteFile.m +++ b/SmartDeviceLink/SDLDeleteFile.m @@ -34,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)syncFileName { - return [parameters sdl_objectForName:SDLRPCParameterNameSyncFileName]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameSyncFileName ofClass:NSString.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLDeleteFileResponse.m b/SmartDeviceLink/SDLDeleteFileResponse.m index d35bc9ed5..78edc6293 100644 --- a/SmartDeviceLink/SDLDeleteFileResponse.m +++ b/SmartDeviceLink/SDLDeleteFileResponse.m @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)spaceAvailable { - return [parameters sdl_objectForName:SDLRPCParameterNameSpaceAvailable]; + return [parameters sdl_objectForName:SDLRPCParameterNameSpaceAvailable ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLDeleteInteractionChoiceSet.m b/SmartDeviceLink/SDLDeleteInteractionChoiceSet.m index ad3027b64..3c1f66bf6 100644 --- a/SmartDeviceLink/SDLDeleteInteractionChoiceSet.m +++ b/SmartDeviceLink/SDLDeleteInteractionChoiceSet.m @@ -34,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)interactionChoiceSetID { - return [parameters sdl_objectForName:SDLRPCParameterNameInteractionChoiceSetId]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameInteractionChoiceSetId ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLDeleteSubMenu.m b/SmartDeviceLink/SDLDeleteSubMenu.m index feadfe3af..44b1f181f 100644 --- a/SmartDeviceLink/SDLDeleteSubMenu.m +++ b/SmartDeviceLink/SDLDeleteSubMenu.m @@ -34,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)menuID { - return [parameters sdl_objectForName:SDLRPCParameterNameMenuId]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameMenuId ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLDeviceInfo.m b/SmartDeviceLink/SDLDeviceInfo.m index 41328e487..6afabdcfd 100644 --- a/SmartDeviceLink/SDLDeviceInfo.m +++ b/SmartDeviceLink/SDLDeviceInfo.m @@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)hardware { - return [store sdl_objectForName:SDLRPCParameterNameHardware]; + return [store sdl_objectForName:SDLRPCParameterNameHardware ofClass:NSString.class]; } - (void)setFirmwareRev:(nullable NSString *)firmwareRev { @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)firmwareRev { - return [store sdl_objectForName:SDLRPCParameterNameFirmwareRevision]; + return [store sdl_objectForName:SDLRPCParameterNameFirmwareRevision ofClass:NSString.class]; } - (void)setOs:(nullable NSString *)os { @@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)os { - return [store sdl_objectForName:SDLRPCParameterNameOS]; + return [store sdl_objectForName:SDLRPCParameterNameOS ofClass:NSString.class]; } - (void)setOsVersion:(nullable NSString *)osVersion { @@ -58,7 +58,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)osVersion { - return [store sdl_objectForName:SDLRPCParameterNameOSVersion]; + return [store sdl_objectForName:SDLRPCParameterNameOSVersion ofClass:NSString.class]; } - (void)setCarrier:(nullable NSString *)carrier { @@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)carrier { - return [store sdl_objectForName:SDLRPCParameterNameCarrier]; + return [store sdl_objectForName:SDLRPCParameterNameCarrier ofClass:NSString.class]; } - (void)setMaxNumberRFCOMMPorts:(nullable NSNumber<SDLInt> *)maxNumberRFCOMMPorts { @@ -74,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)maxNumberRFCOMMPorts { - return [store sdl_objectForName:SDLRPCParameterNameMaxNumberRFCOMMPorts]; + return [store sdl_objectForName:SDLRPCParameterNameMaxNumberRFCOMMPorts ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLDeviceStatus.m b/SmartDeviceLink/SDLDeviceStatus.m index 808dbf0a1..bab61c0f2 100644 --- a/SmartDeviceLink/SDLDeviceStatus.m +++ b/SmartDeviceLink/SDLDeviceStatus.m @@ -17,7 +17,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)voiceRecOn { - return [store sdl_objectForName:SDLRPCParameterNameVoiceRecognitionOn]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameVoiceRecognitionOn ofClass:NSNumber.class error:&error]; } - (void)setBtIconOn:(NSNumber<SDLBool> *)btIconOn { @@ -25,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)btIconOn { - return [store sdl_objectForName:SDLRPCParameterNameBluetoothIconOn]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameBluetoothIconOn ofClass:NSNumber.class error:&error]; } - (void)setCallActive:(NSNumber<SDLBool> *)callActive { @@ -33,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)callActive { - return [store sdl_objectForName:SDLRPCParameterNameCallActive]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameCallActive ofClass:NSNumber.class error:&error]; } - (void)setPhoneRoaming:(NSNumber<SDLBool> *)phoneRoaming { @@ -41,7 +44,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)phoneRoaming { - return [store sdl_objectForName:SDLRPCParameterNamePhoneRoaming]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNamePhoneRoaming ofClass:NSNumber.class error:&error]; } - (void)setTextMsgAvailable:(NSNumber<SDLBool> *)textMsgAvailable { @@ -49,7 +53,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)textMsgAvailable { - return [store sdl_objectForName:SDLRPCParameterNameTextMessageAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameTextMessageAvailable ofClass:NSNumber.class error:&error]; } - (void)setBattLevelStatus:(SDLDeviceLevelStatus )battLevelStatus { @@ -57,7 +62,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLDeviceLevelStatus)battLevelStatus { - return [store sdl_objectForName:SDLRPCParameterNameBatteryLevelStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameBatteryLevelStatus error:&error]; } - (void)setStereoAudioOutputMuted:(NSNumber<SDLBool> *)stereoAudioOutputMuted { @@ -65,7 +71,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)stereoAudioOutputMuted { - return [store sdl_objectForName:SDLRPCParameterNameStereoAudioOutputMuted]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameStereoAudioOutputMuted ofClass:NSNumber.class error:&error]; } - (void)setMonoAudioOutputMuted:(NSNumber<SDLBool> *)monoAudioOutputMuted { @@ -73,7 +80,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)monoAudioOutputMuted { - return [store sdl_objectForName:SDLRPCParameterNameMonoAudioOutputMuted]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameMonoAudioOutputMuted ofClass:NSNumber.class error:&error]; } - (void)setSignalLevelStatus:(SDLDeviceLevelStatus)signalLevelStatus { @@ -81,7 +89,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLDeviceLevelStatus)signalLevelStatus { - return [store sdl_objectForName:SDLRPCParameterNameSignalLevelStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameSignalLevelStatus error:&error]; } - (void)setPrimaryAudioSource:(SDLPrimaryAudioSource)primaryAudioSource { @@ -89,7 +98,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLPrimaryAudioSource)primaryAudioSource { - return [store sdl_objectForName:SDLRPCParameterNamePrimaryAudioSource]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePrimaryAudioSource error:&error]; } - (void)setECallEventActive:(NSNumber<SDLBool> *)eCallEventActive { @@ -97,7 +107,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)eCallEventActive { - return [store sdl_objectForName:SDLRPCParameterNameECallEventActive]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameECallEventActive ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLDiagnosticMessage.m b/SmartDeviceLink/SDLDiagnosticMessage.m index 33478dd9b..95eae8a18 100644 --- a/SmartDeviceLink/SDLDiagnosticMessage.m +++ b/SmartDeviceLink/SDLDiagnosticMessage.m @@ -36,7 +36,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)targetID { - return [parameters sdl_objectForName:SDLRPCParameterNameTargetId]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameTargetId ofClass:NSNumber.class error:&error]; } - (void)setMessageLength:(NSNumber<SDLInt> *)messageLength { @@ -44,7 +45,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)messageLength { - return [parameters sdl_objectForName:SDLRPCParameterNameMessageLength]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameMessageLength ofClass:NSNumber.class error:&error]; } - (void)setMessageData:(NSArray<NSNumber<SDLInt> *> *)messageData { @@ -52,7 +54,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<NSNumber<SDLInt> *> *)messageData { - return [parameters sdl_objectForName:SDLRPCParameterNameMessageData]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameMessageData ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLDiagnosticMessageResponse.m b/SmartDeviceLink/SDLDiagnosticMessageResponse.m index 832054356..ad48d199c 100644 --- a/SmartDeviceLink/SDLDiagnosticMessageResponse.m +++ b/SmartDeviceLink/SDLDiagnosticMessageResponse.m @@ -22,7 +22,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<NSNumber<SDLInt> *> *)messageDataResult { - return [parameters sdl_objectForName:SDLRPCParameterNameMessageDataResult]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameMessageDataResult ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLDialNumber.m b/SmartDeviceLink/SDLDialNumber.m index 644dd8bf8..ae82fac75 100644 --- a/SmartDeviceLink/SDLDialNumber.m +++ b/SmartDeviceLink/SDLDialNumber.m @@ -32,7 +32,8 @@ } - (NSString *)number { - return [parameters sdl_objectForName:SDLRPCParameterNameNumber]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameNumber ofClass:NSString.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLDisplayCapabilities.m b/SmartDeviceLink/SDLDisplayCapabilities.m index d2da9c7d9..015af1159 100644 --- a/SmartDeviceLink/SDLDisplayCapabilities.m +++ b/SmartDeviceLink/SDLDisplayCapabilities.m @@ -18,7 +18,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLDisplayType)displayType { - return [store sdl_objectForName:SDLRPCParameterNameDisplayType]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameDisplayType error:&error]; } - (void)setDisplayName:(nullable NSString *)displayName { @@ -26,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)displayName { - return [store sdl_objectForName:SDLRPCParameterNameDisplayName]; + return [store sdl_objectForName:SDLRPCParameterNameDisplayName ofClass:NSString.class]; } - (void)setTextFields:(NSArray<SDLTextField *> *)textFields { @@ -34,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLTextField *> *)textFields { - return [store sdl_objectsForName:SDLRPCParameterNameTextFields ofClass:SDLTextField.class]; + NSError *error; + return [store sdl_objectsForName:SDLRPCParameterNameTextFields ofClass:SDLTextField.class error:&error]; } - (void)setImageFields:(nullable NSArray<SDLImageField *> *)imageFields { @@ -50,7 +52,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLMediaClockFormat> *)mediaClockFormats { - return [store sdl_objectForName:SDLRPCParameterNameMediaClockFormats]; + NSError *error; + return [store sdl_enumsForName:SDLRPCParameterNameMediaClockFormats error:&error]; } - (void)setGraphicSupported:(NSNumber<SDLBool> *)graphicSupported { @@ -58,7 +61,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)graphicSupported { - return [store sdl_objectForName:SDLRPCParameterNameGraphicSupported]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameGraphicSupported ofClass:NSNumber.class error:&error]; } - (void)setTemplatesAvailable:(nullable NSArray<NSString *> *)templatesAvailable { @@ -66,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)templatesAvailable { - return [store sdl_objectForName:SDLRPCParameterNameTemplatesAvailable]; + return [store sdl_objectsForName:SDLRPCParameterNameTemplatesAvailable ofClass:NSString.class]; } - (void)setScreenParams:(nullable SDLScreenParams *)screenParams { @@ -82,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)numCustomPresetsAvailable { - return [store sdl_objectForName:SDLRPCParameterNameNumberCustomPresetsAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameNumberCustomPresetsAvailable ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLECallInfo.m b/SmartDeviceLink/SDLECallInfo.m index 56a2afe30..55175b12e 100644 --- a/SmartDeviceLink/SDLECallInfo.m +++ b/SmartDeviceLink/SDLECallInfo.m @@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataNotificationStatus)eCallNotificationStatus { - return [store sdl_objectForName:SDLRPCParameterNameECallNotificationStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameECallNotificationStatus error:&error]; } - (void)setAuxECallNotificationStatus:(SDLVehicleDataNotificationStatus)auxECallNotificationStatus { @@ -23,7 +24,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataNotificationStatus)auxECallNotificationStatus { - return [store sdl_objectForName:SDLRPCParameterNameAuxECallNotificationStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameAuxECallNotificationStatus error:&error]; } - (void)setECallConfirmationStatus:(SDLECallConfirmationStatus)eCallConfirmationStatus { @@ -31,7 +33,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLECallConfirmationStatus)eCallConfirmationStatus { - return [store sdl_objectForName:SDLRPCParameterNameECallConfirmationStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameECallConfirmationStatus error:&error]; } @end diff --git a/SmartDeviceLink/SDLEmergencyEvent.m b/SmartDeviceLink/SDLEmergencyEvent.m index 43e9d369d..e071d04c2 100644 --- a/SmartDeviceLink/SDLEmergencyEvent.m +++ b/SmartDeviceLink/SDLEmergencyEvent.m @@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLEmergencyEventType)emergencyEventType { - return [store sdl_objectForName:SDLRPCParameterNameEmergencyEventType]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameEmergencyEventType error:&error]; } - (void)setFuelCutoffStatus:(SDLFuelCutoffStatus)fuelCutoffStatus { @@ -23,7 +24,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLFuelCutoffStatus)fuelCutoffStatus { - return [store sdl_objectForName:SDLRPCParameterNameFuelCutoffStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameFuelCutoffStatus error:&error]; } - (void)setRolloverEvent:(SDLVehicleDataEventStatus)rolloverEvent { @@ -31,7 +33,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)rolloverEvent { - return [store sdl_objectForName:SDLRPCParameterNameRolloverEvent]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameRolloverEvent error:&error]; } - (void)setMaximumChangeVelocity:(NSNumber<SDLInt> *)maximumChangeVelocity { @@ -39,7 +42,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)maximumChangeVelocity { - return [store sdl_objectForName:SDLRPCParameterNameMaximumChangeVelocity]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameMaximumChangeVelocity ofClass:NSNumber.class error:&error]; } - (void)setMultipleEvents:(SDLVehicleDataEventStatus)multipleEvents { @@ -47,7 +51,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataEventStatus)multipleEvents { - return [store sdl_objectForName:SDLRPCParameterNameMultipleEvents]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameMultipleEvents error:&error]; } @end diff --git a/SmartDeviceLink/SDLEncodedSyncPData.m b/SmartDeviceLink/SDLEncodedSyncPData.m index 5b47a155b..0067b5491 100644 --- a/SmartDeviceLink/SDLEncodedSyncPData.m +++ b/SmartDeviceLink/SDLEncodedSyncPData.m @@ -23,7 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<NSString *> *)data { - return [parameters sdl_objectForName:SDLRPCParameterNameData]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameData ofClass:NSString.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLEqualizerSettings.m b/SmartDeviceLink/SDLEqualizerSettings.m index e1ce9d3da..191f5ac78 100644 --- a/SmartDeviceLink/SDLEqualizerSettings.m +++ b/SmartDeviceLink/SDLEqualizerSettings.m @@ -26,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)channelId { - return [store sdl_objectForName:SDLRPCParameterNameChannelId]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameChannelId ofClass:NSNumber.class error:&error]; } - (void)setChannelName:(nullable NSString *)channelName { @@ -34,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)channelName { - return [store sdl_objectForName:SDLRPCParameterNameChannelName]; + return [store sdl_objectForName:SDLRPCParameterNameChannelName ofClass:NSString.class]; } - (void)setChannelSetting:(NSNumber<SDLInt> *)channelSetting { @@ -42,7 +43,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)channelSetting { - return [store sdl_objectForName:SDLRPCParameterNameChannelSetting]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameChannelSetting ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLError.h b/SmartDeviceLink/SDLError.h index dfeba6316..e13f24182 100644 --- a/SmartDeviceLink/SDLError.h +++ b/SmartDeviceLink/SDLError.h @@ -24,6 +24,7 @@ extern SDLErrorDomain *const SDLErrorDomainSoftButtonManager; extern SDLErrorDomain *const SDLErrorDomainMenuManager; extern SDLErrorDomain *const SDLErrorDomainChoiceSetManager; extern SDLErrorDomain *const SDLErrorDomainTransport; +extern SDLErrorDomain *const SDLErrorDomainStore; @interface NSError (SDLErrors) @@ -74,6 +75,10 @@ extern SDLErrorDomain *const SDLErrorDomainTransport; + (NSError *)sdl_transport_connectionTimedOutError; + (NSError *)sdl_transport_networkDownError; +#pragma mark Store + ++ (NSError *)sdl_store_wrongObject:(id)wrongObject expectedType:(Class)type; + @end @interface NSException (SDLExceptions) diff --git a/SmartDeviceLink/SDLError.m b/SmartDeviceLink/SDLError.m index 76415a3cc..a788764ba 100644 --- a/SmartDeviceLink/SDLError.m +++ b/SmartDeviceLink/SDLError.m @@ -19,6 +19,7 @@ SDLErrorDomain *const SDLErrorDomainSoftButtonManager = @"com.sdl.softbuttonmana SDLErrorDomain *const SDLErrorDomainMenuManager = @"com.sdl.menumanager.error"; SDLErrorDomain *const SDLErrorDomainChoiceSetManager = @"com.sdl.choicesetmanager.error"; SDLErrorDomain *const SDLErrorDomainTransport = @"com.sdl.transport.error"; +SDLErrorDomain *const SDLErrorDomainStore = @"com.sdl.dictionary.store"; @implementation NSError (SDLErrors) @@ -265,6 +266,17 @@ SDLErrorDomain *const SDLErrorDomainTransport = @"com.sdl.transport.error"; return [NSError errorWithDomain:SDLErrorDomainTransport code:SDLTransportErrorNetworkDown userInfo:userInfo]; } +#pragma mark Store + ++ (NSError *)sdl_store_wrongObject:(id)wrongObject expectedType:(Class)type { + NSDictionary<NSString *, NSString *> *userInfo = @{ + NSLocalizedDescriptionKey: NSLocalizedString(@"Type of stored value doesn't match with requested", nil), + NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:@"Requested %@ but returned %@", NSStringFromClass(type), NSStringFromClass([wrongObject class])], + NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"Check the expected object type", nil) + }; + return [NSError errorWithDomain:SDLErrorDomainStore code:SDLStoreErrorWrongObject userInfo:userInfo]; +} + @end diff --git a/SmartDeviceLink/SDLErrorConstants.h b/SmartDeviceLink/SDLErrorConstants.h index 1b262418e..0041b88be 100644 --- a/SmartDeviceLink/SDLErrorConstants.h +++ b/SmartDeviceLink/SDLErrorConstants.h @@ -149,3 +149,13 @@ typedef NS_ENUM(NSInteger, SDLTransportError) { */ SDLTransportErrorNetworkDown = -4, }; + +/** + * Errors associated with store. + */ +typedef NS_ENUM(NSInteger, SDLStoreError) { + /** + * In dictionary stored value with unexpected type + */ + SDLStoreErrorWrongObject = -1, +}; diff --git a/SmartDeviceLink/SDLFuelRange.m b/SmartDeviceLink/SDLFuelRange.m index 1ea1f14a0..2e63141c3 100644 --- a/SmartDeviceLink/SDLFuelRange.m +++ b/SmartDeviceLink/SDLFuelRange.m @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLFuelType)type { - return [store sdl_objectForName:SDLRPCParameterNameType]; + return [store sdl_enumForName:SDLRPCParameterNameType error:nil]; } - (void)setRange:(nullable NSNumber<SDLFloat> *)range { @@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)range { - return [store sdl_objectForName:SDLRPCParameterNameRange]; + return [store sdl_objectForName:SDLRPCParameterNameRange ofClass:NSNumber.class]; } diff --git a/SmartDeviceLink/SDLGPSData.m b/SmartDeviceLink/SDLGPSData.m index 3d542c071..aaf616e52 100644 --- a/SmartDeviceLink/SDLGPSData.m +++ b/SmartDeviceLink/SDLGPSData.m @@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLFloat> *)longitudeDegrees { - return [store sdl_objectForName:SDLRPCParameterNameLongitudeDegrees]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameLongitudeDegrees ofClass:NSNumber.class error:&error]; } - (void)setLatitudeDegrees:(NSNumber<SDLFloat> *)latitudeDegrees { @@ -23,7 +24,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLFloat> *)latitudeDegrees { - return [store sdl_objectForName:SDLRPCParameterNameLatitudeDegrees]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameLatitudeDegrees ofClass:NSNumber.class error:&error]; } - (void)setUtcYear:(nullable NSNumber<SDLInt> *)utcYear { @@ -31,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)utcYear { - return [store sdl_objectForName:SDLRPCParameterNameUTCYear]; + return [store sdl_objectForName:SDLRPCParameterNameUTCYear ofClass:NSNumber.class]; } - (void)setUtcMonth:(nullable NSNumber<SDLInt> *)utcMonth { @@ -39,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)utcMonth { - return [store sdl_objectForName:SDLRPCParameterNameUTCMonth]; + return [store sdl_objectForName:SDLRPCParameterNameUTCMonth ofClass:NSNumber.class]; } - (void)setUtcDay:(nullable NSNumber<SDLInt> *)utcDay { @@ -47,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)utcDay { - return [store sdl_objectForName:SDLRPCParameterNameUTCDay]; + return [store sdl_objectForName:SDLRPCParameterNameUTCDay ofClass:NSNumber.class]; } - (void)setUtcHours:(nullable NSNumber<SDLInt> *)utcHours { @@ -55,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)utcHours { - return [store sdl_objectForName:SDLRPCParameterNameUTCHours]; + return [store sdl_objectForName:SDLRPCParameterNameUTCHours ofClass:NSNumber.class]; } - (void)setUtcMinutes:(nullable NSNumber<SDLInt> *)utcMinutes { @@ -63,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)utcMinutes { - return [store sdl_objectForName:SDLRPCParameterNameUTCMinutes]; + return [store sdl_objectForName:SDLRPCParameterNameUTCMinutes ofClass:NSNumber.class]; } - (void)setUtcSeconds:(nullable NSNumber<SDLInt> *)utcSeconds { @@ -71,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)utcSeconds { - return [store sdl_objectForName:SDLRPCParameterNameUTCSeconds]; + return [store sdl_objectForName:SDLRPCParameterNameUTCSeconds ofClass:NSNumber.class]; } - (void)setCompassDirection:(nullable SDLCompassDirection)compassDirection { @@ -79,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLCompassDirection)compassDirection { - return [store sdl_objectForName:SDLRPCParameterNameCompassDirection]; + return [store sdl_enumForName:SDLRPCParameterNameCompassDirection error:nil]; } - (void)setPdop:(nullable NSNumber<SDLFloat> *)pdop { @@ -87,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)pdop { - return [store sdl_objectForName:SDLRPCParameterNamePDOP]; + return [store sdl_objectForName:SDLRPCParameterNamePDOP ofClass:NSNumber.class]; } - (void)setHdop:(nullable NSNumber<SDLFloat> *)hdop { @@ -95,7 +97,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)hdop { - return [store sdl_objectForName:SDLRPCParameterNameHDOP]; + return [store sdl_objectForName:SDLRPCParameterNameHDOP ofClass:NSNumber.class]; } - (void)setVdop:(nullable NSNumber<SDLFloat> *)vdop { @@ -103,7 +105,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)vdop { - return [store sdl_objectForName:SDLRPCParameterNameVDOP]; + return [store sdl_objectForName:SDLRPCParameterNameVDOP ofClass:NSNumber.class]; } - (void)setActual:(nullable NSNumber<SDLBool> *)actual { @@ -111,7 +113,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)actual { - return [store sdl_objectForName:SDLRPCParameterNameActual]; + return [store sdl_objectForName:SDLRPCParameterNameActual ofClass:NSNumber.class]; } - (void)setSatellites:(nullable NSNumber<SDLInt> *)satellites { @@ -119,7 +121,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)satellites { - return [store sdl_objectForName:SDLRPCParameterNameSatellites]; + return [store sdl_objectForName:SDLRPCParameterNameSatellites ofClass:NSNumber.class]; } - (void)setDimension:(nullable SDLDimension)dimension { @@ -127,7 +129,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLDimension)dimension { - return [store sdl_objectForName:SDLRPCParameterNameDimension]; + return [store sdl_enumForName:SDLRPCParameterNameDimension error:nil]; } - (void)setAltitude:(nullable NSNumber<SDLFloat> *)altitude { @@ -135,7 +137,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)altitude { - return [store sdl_objectForName:SDLRPCParameterNameAltitude]; + return [store sdl_objectForName:SDLRPCParameterNameAltitude ofClass:NSNumber.class]; } - (void)setHeading:(nullable NSNumber<SDLFloat> *)heading { @@ -143,7 +145,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)heading { - return [store sdl_objectForName:SDLRPCParameterNameHeading]; + return [store sdl_objectForName:SDLRPCParameterNameHeading ofClass:NSNumber.class]; } - (void)setSpeed:(nullable NSNumber<SDLFloat> *)speed { @@ -151,7 +153,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)speed { - return [store sdl_objectForName:SDLRPCParameterNameSpeed]; + return [store sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLGetAppServiceData.m b/SmartDeviceLink/SDLGetAppServiceData.m index 0122fb088..2a0948834 100644 --- a/SmartDeviceLink/SDLGetAppServiceData.m +++ b/SmartDeviceLink/SDLGetAppServiceData.m @@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)serviceType { - return [parameters sdl_objectForName:SDLRPCParameterNameServiceType]; + return [parameters sdl_objectForName:SDLRPCParameterNameServiceType ofClass:NSString.class]; } - (void)setSubscribe:(nullable NSNumber<SDLBool> *)subscribe { @@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)subscribe { - return [parameters sdl_objectForName:SDLRPCParameterNameSubscribe]; + return [parameters sdl_objectForName:SDLRPCParameterNameSubscribe ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLGetDTCs.m b/SmartDeviceLink/SDLGetDTCs.m index 2d3e5896f..a6bde3cb5 100644 --- a/SmartDeviceLink/SDLGetDTCs.m +++ b/SmartDeviceLink/SDLGetDTCs.m @@ -45,7 +45,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)ecuName { - return [parameters sdl_objectForName:SDLRPCParameterNameECUName]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameECUName ofClass:NSNumber.class error:&error]; } - (void)setDtcMask:(nullable NSNumber<SDLInt> *)dtcMask { @@ -53,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)dtcMask { - return [parameters sdl_objectForName:SDLRPCParameterNameDTCMask]; + return [parameters sdl_objectForName:SDLRPCParameterNameDTCMask ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLGetDTCsResponse.m b/SmartDeviceLink/SDLGetDTCsResponse.m index 0e9ee3d90..af115982b 100644 --- a/SmartDeviceLink/SDLGetDTCsResponse.m +++ b/SmartDeviceLink/SDLGetDTCsResponse.m @@ -23,7 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)ecuHeader { - return [parameters sdl_objectForName:SDLRPCParameterNameECUHeader]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameECUHeader ofClass:NSNumber.class error:&error]; } - (void)setDtc:(NSArray<NSString *> *)dtc { @@ -31,7 +32,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<NSString *> *)dtc { - return [parameters sdl_objectForName:SDLRPCParameterNameDTC]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameDTC ofClass:NSString.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLGetFile.m b/SmartDeviceLink/SDLGetFile.m index 121e56ad7..f7d2bed11 100644 --- a/SmartDeviceLink/SDLGetFile.m +++ b/SmartDeviceLink/SDLGetFile.m @@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)fileName { - return [parameters sdl_objectForName:SDLRPCParameterNameFilename]; + return [parameters sdl_objectForName:SDLRPCParameterNameFilename ofClass:NSString.class]; } - (void)setAppServiceId:(nullable NSString *)appServiceId { @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)appServiceId { - return [parameters sdl_objectForName:SDLRPCParameterNameAppServiceId]; + return [parameters sdl_objectForName:SDLRPCParameterNameAppServiceId ofClass:NSString.class]; } - (void)setFileType:(nullable SDLFileType)fileType { @@ -79,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLFileType)fileType { - return [parameters sdl_objectForName:SDLRPCParameterNameFileType]; + return [parameters sdl_enumForName:SDLRPCParameterNameFileType error:nil]; } - (void)setOffset:(nullable NSNumber<SDLUInt> *)offset { @@ -87,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLUInt> *)offset { - return [parameters sdl_objectForName:SDLRPCParameterNameOffset]; + return [parameters sdl_objectForName:SDLRPCParameterNameOffset ofClass:NSNumber.class]; } - (void)setLength:(nullable NSNumber<SDLUInt> *)length { @@ -95,7 +95,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLUInt> *)length { - return [parameters sdl_objectForName:SDLRPCParameterNameLength]; + return [parameters sdl_objectForName:SDLRPCParameterNameLength ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLGetFileResponse.m b/SmartDeviceLink/SDLGetFileResponse.m index 2d7f0dd47..2f19d5bb5 100644 --- a/SmartDeviceLink/SDLGetFileResponse.m +++ b/SmartDeviceLink/SDLGetFileResponse.m @@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLUInt> *)offset { - return [parameters sdl_objectForName:SDLRPCParameterNameOffset]; + return [parameters sdl_objectForName:SDLRPCParameterNameOffset ofClass:NSNumber.class]; } - (void)setLength:(nullable NSNumber<SDLUInt> *)length { @@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLUInt> *)length { - return [parameters sdl_objectForName:SDLRPCParameterNameLength]; + return [parameters sdl_objectForName:SDLRPCParameterNameLength ofClass:NSNumber.class]; } - (void)setFileType:(nullable SDLFileType)fileType { @@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLFileType)fileType { - return [parameters sdl_objectForName:SDLRPCParameterNameFileType]; + return [parameters sdl_enumForName:SDLRPCParameterNameFileType error:nil]; } - (void)setCrc:(nullable NSNumber<SDLUInt> *)crc { @@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLUInt> *)crc { - return [parameters sdl_objectForName:SDLRPCParameterNameCRC]; + return [parameters sdl_objectForName:SDLRPCParameterNameCRC ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLGetInteriorVehicleData.m b/SmartDeviceLink/SDLGetInteriorVehicleData.m index 4c94fdc44..f29c48820 100755 --- a/SmartDeviceLink/SDLGetInteriorVehicleData.m +++ b/SmartDeviceLink/SDLGetInteriorVehicleData.m @@ -57,7 +57,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLModuleType)moduleType { - return [parameters sdl_objectForName:SDLRPCParameterNameModuleType]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameModuleType error:&error]; } - (void)setSubscribe:(nullable NSNumber<SDLBool> *)subscribe { @@ -65,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)subscribe { - return [parameters sdl_objectForName:SDLRPCParameterNameSubscribe]; + return [parameters sdl_objectForName:SDLRPCParameterNameSubscribe ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLGetInteriorVehicleDataResponse.m b/SmartDeviceLink/SDLGetInteriorVehicleDataResponse.m index 66385d0dc..65c4c9854 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleDataResponse.m +++ b/SmartDeviceLink/SDLGetInteriorVehicleDataResponse.m @@ -24,7 +24,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLModuleData *)moduleData { - return [parameters sdl_objectForName:SDLRPCParameterNameModuleData ofClass:SDLModuleData.class]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameModuleData ofClass:SDLModuleData.class error:&error]; } - (void)setIsSubscribed:(nullable NSNumber<SDLBool> *)isSubscribed { @@ -32,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)isSubscribed { - return [parameters sdl_objectForName:SDLRPCParameterNameIsSubscribed]; + return [parameters sdl_objectForName:SDLRPCParameterNameIsSubscribed ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLGetSystemCapability.m b/SmartDeviceLink/SDLGetSystemCapability.m index 04f049794..74d4df538 100644 --- a/SmartDeviceLink/SDLGetSystemCapability.m +++ b/SmartDeviceLink/SDLGetSystemCapability.m @@ -50,7 +50,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSystemCapabilityType)systemCapabilityType { - return [parameters sdl_objectForName:SDLRPCParameterNameSystemCapabilityType]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameSystemCapabilityType error:&error]; } - (void)setSubscribe:(nullable NSNumber<SDLBool> *)subscribe { @@ -58,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)subscribe { - return [parameters sdl_objectForName:SDLRPCParameterNameSubscribe]; + return [parameters sdl_objectForName:SDLRPCParameterNameSubscribe ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLGetSystemCapabilityResponse.m b/SmartDeviceLink/SDLGetSystemCapabilityResponse.m index cdbeaa6e5..126a87147 100644 --- a/SmartDeviceLink/SDLGetSystemCapabilityResponse.m +++ b/SmartDeviceLink/SDLGetSystemCapabilityResponse.m @@ -32,7 +32,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSystemCapability *)systemCapability { - return [parameters sdl_objectForName:SDLRPCParameterNameSystemCapability ofClass:SDLSystemCapability.class]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameSystemCapability ofClass:SDLSystemCapability.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLGetVehicleData.m b/SmartDeviceLink/SDLGetVehicleData.m index 8ef6a5cd9..66f7adfe1 100644 --- a/SmartDeviceLink/SDLGetVehicleData.m +++ b/SmartDeviceLink/SDLGetVehicleData.m @@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)gps { - return [parameters sdl_objectForName:SDLRPCParameterNameGPS]; + return [parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:NSNumber.class]; } - (void)setSpeed:(nullable NSNumber<SDLBool> *)speed { @@ -74,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)speed { - return [parameters sdl_objectForName:SDLRPCParameterNameSpeed]; + return [parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class]; } - (void)setRpm:(nullable NSNumber<SDLBool> *)rpm { @@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)rpm { - return [parameters sdl_objectForName:SDLRPCParameterNameRPM]; + return [parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class]; } - (void)setFuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel { @@ -90,7 +90,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelLevel { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevel]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class]; } - (void)setFuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State { @@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelLevel_State { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState ofClass:NSNumber.class]; } - (void)setFuelRange:(nullable NSNumber<SDLBool> *)fuelRange { @@ -106,7 +106,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelRange { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelRange]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelRange ofClass:NSNumber.class]; } - (void)setInstantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption { @@ -114,7 +114,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)instantFuelConsumption { - return [parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption]; + return [parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class]; } - (void)setExternalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature { @@ -122,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)externalTemperature { - return [parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature]; + return [parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class]; } - (void)setVin:(nullable NSNumber<SDLBool> *)vin { @@ -130,7 +130,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)vin { - return [parameters sdl_objectForName:SDLRPCParameterNameVIN]; + return [parameters sdl_objectForName:SDLRPCParameterNameVIN ofClass:NSNumber.class]; } - (void)setPrndl:(nullable NSNumber<SDLBool> *)prndl { @@ -138,7 +138,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)prndl { - return [parameters sdl_objectForName:SDLRPCParameterNamePRNDL]; + return [parameters sdl_objectForName:SDLRPCParameterNamePRNDL ofClass:NSNumber.class]; } - (void)setTirePressure:(nullable NSNumber<SDLBool> *)tirePressure { @@ -146,7 +146,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)tirePressure { - return [parameters sdl_objectForName:SDLRPCParameterNameTirePressure]; + return [parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:NSNumber.class]; } - (void)setOdometer:(nullable NSNumber<SDLBool> *)odometer { @@ -154,7 +154,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)odometer { - return [parameters sdl_objectForName:SDLRPCParameterNameOdometer]; + return [parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class]; } - (void)setBeltStatus:(nullable NSNumber<SDLBool> *)beltStatus { @@ -162,7 +162,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)beltStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameBeltStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:NSNumber.class]; } - (void)setBodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation { @@ -170,7 +170,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)bodyInformation { - return [parameters sdl_objectForName:SDLRPCParameterNameBodyInformation]; + return [parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:NSNumber.class]; } - (void)setDeviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus { @@ -178,7 +178,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)deviceStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:NSNumber.class]; } - (void)setDriverBraking:(nullable NSNumber<SDLBool> *)driverBraking { @@ -186,7 +186,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)driverBraking { - return [parameters sdl_objectForName:SDLRPCParameterNameDriverBraking]; + return [parameters sdl_objectForName:SDLRPCParameterNameDriverBraking ofClass:NSNumber.class]; } - (void)setWiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus { @@ -194,7 +194,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)wiperStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameWiperStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameWiperStatus ofClass:NSNumber.class]; } - (void)setHeadLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus { @@ -202,7 +202,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)headLampStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:NSNumber.class]; } - (void)setEngineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife { @@ -210,7 +210,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)engineOilLife { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class]; } - (void)setEngineTorque:(nullable NSNumber<SDLBool> *)engineTorque { @@ -218,7 +218,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)engineTorque { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineTorque]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class]; } - (void)setAccPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition { @@ -226,7 +226,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)accPedalPosition { - return [parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition]; + return [parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class]; } - (void)setSteeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle { @@ -234,7 +234,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)steeringWheelAngle { - return [parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle]; + return [parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class]; } - (void)setECallInfo:(nullable NSNumber<SDLBool> *)eCallInfo { @@ -242,7 +242,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)eCallInfo { - return [parameters sdl_objectForName:SDLRPCParameterNameECallInfo]; + return [parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:NSNumber.class]; } - (void)setAirbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus { @@ -250,7 +250,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)airbagStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:NSNumber.class]; } - (void)setEmergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent { @@ -258,7 +258,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)emergencyEvent { - return [parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent]; + return [parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:NSNumber.class]; } - (void)setClusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus { @@ -266,7 +266,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)clusterModeStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus ofClass:NSNumber.class]; } - (void)setMyKey:(nullable NSNumber<SDLBool> *)myKey { @@ -274,7 +274,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)myKey { - return [parameters sdl_objectForName:SDLRPCParameterNameMyKey]; + return [parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:NSNumber.class]; } - (void)setElectronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus { @@ -282,7 +282,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)electronicParkBrakeStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus ofClass:NSNumber.class]; } - (void)setTurnSignal:(nullable NSNumber<SDLBool> *)turnSignal { @@ -290,7 +290,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)turnSignal { - return [parameters sdl_objectForName:SDLRPCParameterNameTurnSignal]; + return [parameters sdl_objectForName:SDLRPCParameterNameTurnSignal ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLGetVehicleDataResponse.m b/SmartDeviceLink/SDLGetVehicleDataResponse.m index b9e64c0e8..8a8975591 100644 --- a/SmartDeviceLink/SDLGetVehicleDataResponse.m +++ b/SmartDeviceLink/SDLGetVehicleDataResponse.m @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)speed { - return [parameters sdl_objectForName:SDLRPCParameterNameSpeed]; + return [parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class]; } - (void)setRpm:(nullable NSNumber<SDLInt> *)rpm { @@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)rpm { - return [parameters sdl_objectForName:SDLRPCParameterNameRPM]; + return [parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class]; } - (void)setFuelLevel:(nullable NSNumber<SDLFloat> *)fuelLevel { @@ -59,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)fuelLevel { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevel]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class]; } - (void)setFuelLevel_State:(nullable SDLComponentVolumeStatus)fuelLevel_State { @@ -67,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLComponentVolumeStatus)fuelLevel_State { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState]; + return [parameters sdl_enumForName:SDLRPCParameterNameFuelLevelState error:nil]; } - (void)setInstantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption { @@ -83,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)instantFuelConsumption { - return [parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption]; + return [parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class]; } - (void)setExternalTemperature:(nullable NSNumber<SDLFloat> *)externalTemperature { @@ -91,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)externalTemperature { - return [parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature]; + return [parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class]; } - (void)setVin:(nullable NSString *)vin { @@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)vin { - return [parameters sdl_objectForName:SDLRPCParameterNameVIN]; + return [parameters sdl_objectForName:SDLRPCParameterNameVIN ofClass:NSString.class]; } - (void)setPrndl:(nullable SDLPRNDL)prndl { @@ -107,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLPRNDL)prndl { - return [parameters sdl_objectForName:SDLRPCParameterNamePRNDL]; + return [parameters sdl_enumForName:SDLRPCParameterNamePRNDL error:nil]; } - (void)setTirePressure:(nullable SDLTireStatus *)tirePressure { @@ -123,7 +123,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)odometer { - return [parameters sdl_objectForName:SDLRPCParameterNameOdometer]; + return [parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class]; } - (void)setBeltStatus:(nullable SDLBeltStatus *)beltStatus { @@ -155,7 +155,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataEventStatus)driverBraking { - return [parameters sdl_objectForName:SDLRPCParameterNameDriverBraking]; + return [parameters sdl_enumForName:SDLRPCParameterNameDriverBraking error:nil]; } - (void)setWiperStatus:(nullable SDLWiperStatus)wiperStatus { @@ -163,7 +163,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLWiperStatus)wiperStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameWiperStatus]; + return [parameters sdl_enumForName:SDLRPCParameterNameWiperStatus error:nil]; } - (void)setHeadLampStatus:(nullable SDLHeadLampStatus *)headLampStatus { @@ -179,7 +179,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)engineOilLife { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class]; } - (void)setEngineTorque:(nullable NSNumber<SDLFloat> *)engineTorque { @@ -187,7 +187,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)engineTorque { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineTorque]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class]; } - (void)setAccPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition { @@ -195,7 +195,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)accPedalPosition { - return [parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition]; + return [parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class]; } - (void)setSteeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle { @@ -203,7 +203,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)steeringWheelAngle { - return [parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle]; + return [parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class]; } - (void)setECallInfo:(nullable SDLECallInfo *)eCallInfo { @@ -251,7 +251,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus]; + return [parameters sdl_enumForName:SDLRPCParameterNameElectronicParkBrakeStatus error:nil]; } - (void)setTurnSignal:(nullable SDLTurnSignal)turnSignal { @@ -259,7 +259,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLTurnSignal)turnSignal { - return [parameters sdl_objectForName:SDLRPCParameterNameTurnSignal]; + return [parameters sdl_enumForName:SDLRPCParameterNameTurnSignal error:nil]; } @end diff --git a/SmartDeviceLink/SDLGetWayPoints.m b/SmartDeviceLink/SDLGetWayPoints.m index 804c13d27..1c3ebe700 100644 --- a/SmartDeviceLink/SDLGetWayPoints.m +++ b/SmartDeviceLink/SDLGetWayPoints.m @@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLWayPointType)waypointType { - return [parameters sdl_objectForName:SDLRPCParameterNameWayPointType]; + return [parameters sdl_enumForName:SDLRPCParameterNameWayPointType error:nil]; } @end diff --git a/SmartDeviceLink/SDLHMICapabilities.m b/SmartDeviceLink/SDLHMICapabilities.m index 1661fa32f..87d57ddab 100644 --- a/SmartDeviceLink/SDLHMICapabilities.m +++ b/SmartDeviceLink/SDLHMICapabilities.m @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)navigation { - return [store sdl_objectForName:SDLRPCParameterNameNavigation]; + return [store sdl_objectForName:SDLRPCParameterNameNavigation ofClass:NSNumber.class]; } - (void)setPhoneCall:(nullable NSNumber<SDLBool> *)phoneCall { @@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)phoneCall { - return [store sdl_objectForName:SDLRPCParameterNamePhoneCall]; + return [store sdl_objectForName:SDLRPCParameterNamePhoneCall ofClass:NSNumber.class]; } - (void)setVideoStreaming:(nullable NSNumber<SDLBool> *)videoStreaming { @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)videoStreaming { - return [store sdl_objectForName:SDLRPCParameterNameVideoStreaming]; + return [store sdl_objectForName:SDLRPCParameterNameVideoStreaming ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLHMIPermissions.m b/SmartDeviceLink/SDLHMIPermissions.m index 34c0ae289..dec88e5dd 100644 --- a/SmartDeviceLink/SDLHMIPermissions.m +++ b/SmartDeviceLink/SDLHMIPermissions.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLHMILevel> *)allowed { - return [store sdl_objectForName:SDLRPCParameterNameAllowed]; + NSError *error; + return [store sdl_enumsForName:SDLRPCParameterNameAllowed error:&error]; } - (void)setUserDisallowed:(NSArray<SDLHMILevel> *)userDisallowed { @@ -24,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLHMILevel> *)userDisallowed { - return [store sdl_objectForName:SDLRPCParameterNameUserDisallowed]; + NSError *error; + return [store sdl_enumsForName:SDLRPCParameterNameUserDisallowed error:&error]; } @end diff --git a/SmartDeviceLink/SDLHMISettingsControlCapabilities.m b/SmartDeviceLink/SDLHMISettingsControlCapabilities.m index 12861d6f1..295e5b99a 100644 --- a/SmartDeviceLink/SDLHMISettingsControlCapabilities.m +++ b/SmartDeviceLink/SDLHMISettingsControlCapabilities.m @@ -37,7 +37,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)moduleName { - return [store sdl_objectForName:SDLRPCParameterNameModuleName]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameModuleName ofClass:NSString.class error:&error]; } @@ -46,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)distanceUnitAvailable { - return [store sdl_objectForName:SDLRPCParameterNameDistanceUnitAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameDistanceUnitAvailable ofClass:NSNumber.class]; } - (void)setTemperatureUnitAvailable:(nullable NSNumber<SDLBool> *)temperatureUnitAvailable { @@ -54,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)temperatureUnitAvailable { - return [store sdl_objectForName:SDLRPCParameterNameTemperatureUnitAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameTemperatureUnitAvailable ofClass:NSNumber.class]; } - (void)setDisplayModeUnitAvailable:(nullable NSNumber<SDLBool> *)displayModeUnitAvailable { @@ -62,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)displayModeUnitAvailable { - return [store sdl_objectForName:SDLRPCParameterNameDisplayModeUnitAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameDisplayModeUnitAvailable ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLHMISettingsControlData.m b/SmartDeviceLink/SDLHMISettingsControlData.m index d8eb2c11c..15a36ed52 100644 --- a/SmartDeviceLink/SDLHMISettingsControlData.m +++ b/SmartDeviceLink/SDLHMISettingsControlData.m @@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLDisplayMode)displayMode { - return [store sdl_objectForName:SDLRPCParameterNameDisplayMode]; + return [store sdl_enumForName:SDLRPCParameterNameDisplayMode error:nil]; } - (void)setDistanceUnit:(nullable SDLDistanceUnit)distanceUnit { @@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLDistanceUnit)distanceUnit { - return [store sdl_objectForName:SDLRPCParameterNameDistanceUnit]; + return [store sdl_enumForName:SDLRPCParameterNameDistanceUnit error:nil]; } - (void)setTemperatureUnit:(nullable SDLTemperatureUnit)temperatureUnit { @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLTemperatureUnit)temperatureUnit { - return [store sdl_objectForName:SDLRPCParameterNameTemperatureUnit]; + return [store sdl_enumForName:SDLRPCParameterNameTemperatureUnit error:nil]; } @end diff --git a/SmartDeviceLink/SDLHapticRect.m b/SmartDeviceLink/SDLHapticRect.m index 715b26e03..b64959ce3 100644 --- a/SmartDeviceLink/SDLHapticRect.m +++ b/SmartDeviceLink/SDLHapticRect.m @@ -32,7 +32,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)id { - return [store sdl_objectForName:SDLRPCParameterNameId]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameId ofClass:NSNumber.class error:&error]; } - (void)setRect:(SDLRectangle *)rect { diff --git a/SmartDeviceLink/SDLHeadLampStatus.m b/SmartDeviceLink/SDLHeadLampStatus.m index 0d45654a1..54bb94262 100644 --- a/SmartDeviceLink/SDLHeadLampStatus.m +++ b/SmartDeviceLink/SDLHeadLampStatus.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)lowBeamsOn { - return [store sdl_objectForName:SDLRPCParameterNameLowBeamsOn]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameLowBeamsOn ofClass:NSNumber.class error:&error]; } - (void)setHighBeamsOn:(NSNumber<SDLBool> *)highBeamsOn { @@ -24,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)highBeamsOn { - return [store sdl_objectForName:SDLRPCParameterNameHighBeamsOn]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameHighBeamsOn ofClass:NSNumber.class error:&error]; } - (void)setAmbientLightSensorStatus:(nullable SDLAmbientLightStatus)ambientLightSensorStatus { @@ -32,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLAmbientLightStatus)ambientLightSensorStatus { - return [store sdl_objectForName:SDLRPCParameterNameAmbientLightSensorStatus]; + return [store sdl_enumForName:SDLRPCParameterNameAmbientLightSensorStatus error:nil]; } @end diff --git a/SmartDeviceLink/SDLImage.m b/SmartDeviceLink/SDLImage.m index a799ae09e..9e3c7c439 100644 --- a/SmartDeviceLink/SDLImage.m +++ b/SmartDeviceLink/SDLImage.m @@ -61,7 +61,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)value { - return [store sdl_objectForName:SDLRPCParameterNameValue]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameValue ofClass:NSString.class error:&error]; } - (void)setImageType:(SDLImageType)imageType { @@ -69,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLImageType)imageType { - return [store sdl_objectForName:SDLRPCParameterNameImageType]; + return [store sdl_enumForName:SDLRPCParameterNameImageType error:nil]; } - (void)setIsTemplate:(NSNumber<SDLBool> *)isTemplate { @@ -77,7 +78,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)isTemplate { - return [store sdl_objectForName:SDLRPCParameterNameImageTemplate]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameImageTemplate ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLImageField.m b/SmartDeviceLink/SDLImageField.m index f4420c6fe..0bef1383a 100644 --- a/SmartDeviceLink/SDLImageField.m +++ b/SmartDeviceLink/SDLImageField.m @@ -17,7 +17,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLImageFieldName)name { - return [store sdl_objectForName:SDLRPCParameterNameName]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameName error:&error]; } - (void)setImageTypeSupported:(NSArray<SDLFileType> *)imageTypeSupported { @@ -25,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLFileType> *)imageTypeSupported { - return [store sdl_objectForName:SDLRPCParameterNameImageTypeSupported]; + NSError *error; + return [store sdl_enumsForName:SDLRPCParameterNameImageTypeSupported error:&error]; } - (void)setImageResolution:(nullable SDLImageResolution *)imageResolution { diff --git a/SmartDeviceLink/SDLImageResolution.m b/SmartDeviceLink/SDLImageResolution.m index a8497acd4..d766ab86f 100644 --- a/SmartDeviceLink/SDLImageResolution.m +++ b/SmartDeviceLink/SDLImageResolution.m @@ -26,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)resolutionWidth { - return [store sdl_objectForName:SDLRPCParameterNameResolutionWidth]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameResolutionWidth ofClass:NSNumber.class error:&error]; } - (void)setResolutionHeight:(NSNumber<SDLInt> *)resolutionHeight { @@ -34,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)resolutionHeight { - return [store sdl_objectForName:SDLRPCParameterNameResolutionHeight]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameResolutionHeight ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLKeyboardProperties.m b/SmartDeviceLink/SDLKeyboardProperties.m index 0c2183353..027229a6a 100644 --- a/SmartDeviceLink/SDLKeyboardProperties.m +++ b/SmartDeviceLink/SDLKeyboardProperties.m @@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLLanguage)language { - return [store sdl_objectForName:SDLRPCParameterNameLanguage]; + return [store sdl_enumForName:SDLRPCParameterNameLanguage error:nil]; } - (void)setKeyboardLayout:(nullable SDLKeyboardLayout)keyboardLayout { @@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLKeyboardLayout)keyboardLayout { - return [store sdl_objectForName:SDLRPCParameterNameKeyboardLayout]; + return [store sdl_enumForName:SDLRPCParameterNameKeyboardLayout error:nil]; } - (void)setKeypressMode:(nullable SDLKeypressMode)keypressMode { @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLKeypressMode)keypressMode { - return [store sdl_objectForName:SDLRPCParameterNameKeypressMode]; + return [store sdl_enumForName:SDLRPCParameterNameKeypressMode error:nil]; } - (void)setLimitedCharacterList:(nullable NSArray<NSString *> *)limitedCharacterList { @@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)limitedCharacterList { - return [store sdl_objectForName:SDLRPCParameterNameLimitedCharacterList]; + return [store sdl_objectsForName:SDLRPCParameterNameLimitedCharacterList ofClass:NSString.class]; } - (void)setAutoCompleteText:(nullable NSString *)autoCompleteText { @@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)autoCompleteText { - return [store sdl_objectForName:SDLRPCParameterNameAutoCompleteText]; + return [store sdl_objectForName:SDLRPCParameterNameAutoCompleteText ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLLightCapabilities.m b/SmartDeviceLink/SDLLightCapabilities.m index 24ad0adb3..1338cc7c1 100644 --- a/SmartDeviceLink/SDLLightCapabilities.m +++ b/SmartDeviceLink/SDLLightCapabilities.m @@ -37,7 +37,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLLightName)name { - return [store sdl_objectForName:SDLRPCParameterNameName]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameName error:&error]; } - (void)setDensityAvailable:(nullable NSNumber<SDLBool> *)densityAvailable { @@ -45,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)densityAvailable { - return [store sdl_objectForName:SDLRPCParameterNameDensityAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameDensityAvailable ofClass:NSNumber.class]; } - (void)setColorAvailable:(nullable NSNumber<SDLBool> *)colorAvailable { @@ -53,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)colorAvailable { - return [store sdl_objectForName:SDLRPCParameterNameRGBColorSpaceAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameRGBColorSpaceAvailable ofClass:NSNumber.class]; } - (void)setStatusAvailable:(nullable NSNumber<SDLBool> *)statusAvailable { @@ -61,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)statusAvailable { - return [store sdl_objectForName:SDLRPCParameterNameStatusAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameStatusAvailable ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLLightControlCapabilities.m b/SmartDeviceLink/SDLLightControlCapabilities.m index 645a53ebd..3b8fa0328 100644 --- a/SmartDeviceLink/SDLLightControlCapabilities.m +++ b/SmartDeviceLink/SDLLightControlCapabilities.m @@ -27,7 +27,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)moduleName { - return [store sdl_objectForName:SDLRPCParameterNameModuleName]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameModuleName ofClass:NSString.class error:&error]; } - (void)setSupportedLights:(NSArray<SDLLightCapabilities *> *)supportedLights { @@ -36,7 +37,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLLightCapabilities *> *)supportedLights { - return [store sdl_objectsForName:SDLRPCParameterNameSupportedLights ofClass:SDLLightCapabilities.class]; + NSError *error; + return [store sdl_objectsForName:SDLRPCParameterNameSupportedLights ofClass:SDLLightCapabilities.class error:&error]; } diff --git a/SmartDeviceLink/SDLLightControlData.m b/SmartDeviceLink/SDLLightControlData.m index d10faa92d..80624221d 100644 --- a/SmartDeviceLink/SDLLightControlData.m +++ b/SmartDeviceLink/SDLLightControlData.m @@ -25,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLLightState *> *)lightState { - return [store sdl_objectsForName:SDLRPCParameterNameLightState ofClass:SDLLightState.class]; + NSError *error; + return [store sdl_objectsForName:SDLRPCParameterNameLightState ofClass:SDLLightState.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLLightState.m b/SmartDeviceLink/SDLLightState.m index 405a4723b..f33080b7e 100644 --- a/SmartDeviceLink/SDLLightState.m +++ b/SmartDeviceLink/SDLLightState.m @@ -52,7 +52,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLLightName)id { - return [store sdl_objectForName:SDLRPCParameterNameId]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameId error:&error]; } - (void)setStatus:(SDLLightStatus)status { @@ -60,7 +61,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLLightStatus)status { - return [store sdl_objectForName:SDLRPCParameterNameStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameStatus error:&error]; } - (void)setDensity:(nullable NSNumber<SDLFloat> *)density { @@ -68,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)density { - return [store sdl_objectForName:SDLRPCParameterNameDensity]; + return [store sdl_objectForName:SDLRPCParameterNameDensity ofClass:NSNumber.class]; } - (void)setColor:(nullable SDLRGBColor *)color { diff --git a/SmartDeviceLink/SDLListFilesResponse.m b/SmartDeviceLink/SDLListFilesResponse.m index 10405df4e..5a0059351 100644 --- a/SmartDeviceLink/SDLListFilesResponse.m +++ b/SmartDeviceLink/SDLListFilesResponse.m @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)filenames { - return [parameters sdl_objectForName:SDLRPCParameterNameFilenames]; + return [parameters sdl_objectsForName:SDLRPCParameterNameFilenames ofClass:NSString.class]; } - (void)setSpaceAvailable:(nullable NSNumber<SDLInt> *)spaceAvailable { @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)spaceAvailable { - return [parameters sdl_objectForName:SDLRPCParameterNameSpaceAvailable]; + return [parameters sdl_objectForName:SDLRPCParameterNameSpaceAvailable ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLLocationCoordinate.m b/SmartDeviceLink/SDLLocationCoordinate.m index a5d1cdd3d..00d1d3ae4 100644 --- a/SmartDeviceLink/SDLLocationCoordinate.m +++ b/SmartDeviceLink/SDLLocationCoordinate.m @@ -27,7 +27,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLFloat> *)longitudeDegrees { - return [store sdl_objectForName:SDLRPCParameterNameLongitudeDegrees]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameLongitudeDegrees ofClass:NSNumber.class error:&error]; } - (void)setLatitudeDegrees:(NSNumber<SDLFloat> *)latitudeDegrees { @@ -35,7 +36,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLFloat> *)latitudeDegrees { - return [store sdl_objectForName:SDLRPCParameterNameLatitudeDegrees]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameLatitudeDegrees ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLLocationDetails.m b/SmartDeviceLink/SDLLocationDetails.m index 7cc609851..983aff11c 100644 --- a/SmartDeviceLink/SDLLocationDetails.m +++ b/SmartDeviceLink/SDLLocationDetails.m @@ -53,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)locationName { - return [store sdl_objectForName:SDLRPCParameterNameLocationName]; + return [store sdl_objectForName:SDLRPCParameterNameLocationName ofClass:NSString.class]; } - (void)setAddressLines:(nullable NSArray<NSString *> *)addressLines { @@ -61,7 +61,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)addressLines { - return [store sdl_objectForName:SDLRPCParameterNameAddressLines]; + return [store sdl_objectsForName:SDLRPCParameterNameAddressLines ofClass:NSString.class]; } - (void)setLocationDescription:(nullable NSString *)locationDescription { @@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)locationDescription { - return [store sdl_objectForName:SDLRPCParameterNameLocationDescription]; + return [store sdl_objectForName:SDLRPCParameterNameLocationDescription ofClass:NSString.class]; } - (void)setPhoneNumber:(nullable NSString *)phoneNumber { @@ -77,7 +77,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)phoneNumber { - return [store sdl_objectForName:SDLRPCParameterNamePhoneNumber]; + return [store sdl_objectForName:SDLRPCParameterNamePhoneNumber ofClass:NSString.class]; } - (void)setLocationImage:(nullable SDLImage *)locationImage { diff --git a/SmartDeviceLink/SDLMassageCushionFirmness.m b/SmartDeviceLink/SDLMassageCushionFirmness.m index 9cede76b7..a61efdcbe 100644 --- a/SmartDeviceLink/SDLMassageCushionFirmness.m +++ b/SmartDeviceLink/SDLMassageCushionFirmness.m @@ -26,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLMassageCushion)cushion { - return [store sdl_objectForName:SDLRPCParameterNameCushion]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameCushion error:&error]; } - (void)setFirmness:(NSNumber<SDLInt> *)firmness { @@ -34,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)firmness { - return [store sdl_objectForName:SDLRPCParameterNameFirmness]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameFirmness ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLMassageModeData.m b/SmartDeviceLink/SDLMassageModeData.m index a50f39b4c..bd24ba906 100644 --- a/SmartDeviceLink/SDLMassageModeData.m +++ b/SmartDeviceLink/SDLMassageModeData.m @@ -26,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLMassageMode)massageMode { - return [store sdl_objectForName:SDLRPCParameterNameMassageMode]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameMassageMode error:&error]; } - (void)setMassageZone:(SDLMassageZone)massageZone { @@ -34,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLMassageZone)massageZone { - return [store sdl_objectForName:SDLRPCParameterNameMassageZone]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameMassageZone error:&error]; } @end diff --git a/SmartDeviceLink/SDLMediaServiceData.m b/SmartDeviceLink/SDLMediaServiceData.m index 3194fc4ab..ffdc4b919 100644 --- a/SmartDeviceLink/SDLMediaServiceData.m +++ b/SmartDeviceLink/SDLMediaServiceData.m @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLMediaType)mediaType { - return [store sdl_objectForName:SDLRPCParameterNameMediaType]; + return [store sdl_enumForName:SDLRPCParameterNameMediaType error:nil]; } - (void)setMediaTitle:(nullable NSString *)mediaTitle { @@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)mediaTitle { - return [store sdl_objectForName:SDLRPCParameterNameMediaTitle]; + return [store sdl_objectForName:SDLRPCParameterNameMediaTitle ofClass:NSString.class]; } - (void)setMediaArtist:(nullable NSString *)mediaArtist { @@ -58,7 +58,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)mediaArtist { - return [store sdl_objectForName:SDLRPCParameterNameMediaArtist]; + return [store sdl_objectForName:SDLRPCParameterNameMediaArtist ofClass:NSString.class]; } - (void)setMediaAlbum:(nullable NSString *)mediaAlbum { @@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)mediaAlbum { - return [store sdl_objectForName:SDLRPCParameterNameMediaAlbum]; + return [store sdl_objectForName:SDLRPCParameterNameMediaAlbum ofClass:NSString.class]; } - (void)setPlaylistName:(nullable NSString *)playlistName { @@ -74,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)playlistName { - return [store sdl_objectForName:SDLRPCParameterNamePlaylistName]; + return [store sdl_objectForName:SDLRPCParameterNamePlaylistName ofClass:NSString.class]; } - (void)setIsExplicit:(nullable NSNumber<SDLBool> *)isExplicit { @@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)isExplicit { - return [store sdl_objectForName:SDLRPCParameterNameIsExplicit]; + return [store sdl_objectForName:SDLRPCParameterNameIsExplicit ofClass:NSNumber.class]; } - (void)setTrackPlaybackProgress:(nullable NSNumber<SDLInt> *)trackPlaybackProgress { @@ -90,7 +90,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)trackPlaybackProgress { - return [store sdl_objectForName:SDLRPCParameterNameTrackPlaybackProgress]; + return [store sdl_objectForName:SDLRPCParameterNameTrackPlaybackProgress ofClass:NSNumber.class]; } - (void)setTrackPlaybackDuration:(nullable NSNumber<SDLInt> *)trackPlaybackDuration { @@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)trackPlaybackDuration { - return [store sdl_objectForName:SDLRPCParameterNameTrackPlaybackDuration]; + return [store sdl_objectForName:SDLRPCParameterNameTrackPlaybackDuration ofClass:NSNumber.class]; } - (void)setQueuePlaybackProgress:(nullable NSNumber<SDLInt> *)queuePlaybackProgress { @@ -106,7 +106,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)queuePlaybackProgress { - return [store sdl_objectForName:SDLRPCParameterNameQueuePlaybackProgress]; + return [store sdl_objectForName:SDLRPCParameterNameQueuePlaybackProgress ofClass:NSNumber.class]; } - (void)setQueuePlaybackDuration:(nullable NSNumber<SDLInt> *)queuePlaybackDuration { @@ -114,7 +114,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)queuePlaybackDuration { - return [store sdl_objectForName:SDLRPCParameterNameQueuePlaybackDuration]; + return [store sdl_objectForName:SDLRPCParameterNameQueuePlaybackDuration ofClass:NSNumber.class]; } - (void)setQueueCurrentTrackNumber:(nullable NSNumber<SDLInt> *)queueCurrentTrackNumber { @@ -122,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)queueCurrentTrackNumber { - return [store sdl_objectForName:SDLRPCParameterNameQueueCurrentTrackNumber]; + return [store sdl_objectForName:SDLRPCParameterNameQueueCurrentTrackNumber ofClass:NSNumber.class]; } - (void)setQueueTotalTrackCount:(nullable NSNumber<SDLInt> *)queueTotalTrackCount { @@ -130,7 +130,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)queueTotalTrackCount { - return [store sdl_objectForName:SDLRPCParameterNameQueueTotalTrackCount]; + return [store sdl_objectForName:SDLRPCParameterNameQueueTotalTrackCount ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLMenuParams.m b/SmartDeviceLink/SDLMenuParams.m index e7998d06d..873004150 100644 --- a/SmartDeviceLink/SDLMenuParams.m +++ b/SmartDeviceLink/SDLMenuParams.m @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)parentID { - return [store sdl_objectForName:SDLRPCParameterNameParentId]; + return [store sdl_objectForName:SDLRPCParameterNameParentId ofClass:NSNumber.class]; } - (void)setPosition:(nullable NSNumber<SDLInt> *)position { @@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)position { - return [store sdl_objectForName:SDLRPCParameterNamePosition]; + return [store sdl_objectForName:SDLRPCParameterNamePosition ofClass:NSNumber.class]; } - (void)setMenuName:(NSString *)menuName { @@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)menuName { - return [store sdl_objectForName:SDLRPCParameterNameMenuName]; + return [store sdl_objectForName:SDLRPCParameterNameMenuName ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLMetadataTags.m b/SmartDeviceLink/SDLMetadataTags.m index 2b0f1f1b0..0b5850d07 100644 --- a/SmartDeviceLink/SDLMetadataTags.m +++ b/SmartDeviceLink/SDLMetadataTags.m @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLMetadataType> *)mainField1 { - return [store sdl_objectForName:SDLRPCParameterNameMainField1]; + return [store sdl_enumsForName:SDLRPCParameterNameMainField1 error:nil]; } - (void)setMainField2:(nullable NSArray<SDLMetadataType> *)mainField2 { @@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLMetadataType> *)mainField2 { - return [store sdl_objectForName:SDLRPCParameterNameMainField2]; + return [store sdl_enumsForName:SDLRPCParameterNameMainField2 error:nil]; } - (void)setMainField3:(nullable NSArray<SDLMetadataType> *)mainField3 { @@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLMetadataType> *)mainField3 { - return [store sdl_objectForName:SDLRPCParameterNameMainField3]; + return [store sdl_enumsForName:SDLRPCParameterNameMainField3 error:nil]; } - (void)setMainField4:(nullable NSArray<SDLMetadataType> *)mainField4 { @@ -70,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLMetadataType> *)mainField4 { - return [store sdl_objectForName:SDLRPCParameterNameMainField4]; + return [store sdl_enumsForName:SDLRPCParameterNameMainField4 error:nil]; } @end diff --git a/SmartDeviceLink/SDLModuleData.m b/SmartDeviceLink/SDLModuleData.m index 12b5b3f60..22a87682d 100644 --- a/SmartDeviceLink/SDLModuleData.m +++ b/SmartDeviceLink/SDLModuleData.m @@ -93,7 +93,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLModuleType)moduleType { - return [store sdl_objectForName:SDLRPCParameterNameModuleType]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameModuleType error:&error]; } - (void)setRadioControlData:(nullable SDLRadioControlData *)radioControlData { diff --git a/SmartDeviceLink/SDLMyKey.m b/SmartDeviceLink/SDLMyKey.m index 8d2e807bd..751e23556 100644 --- a/SmartDeviceLink/SDLMyKey.m +++ b/SmartDeviceLink/SDLMyKey.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataStatus)e911Override { - return [store sdl_objectForName:SDLRPCParameterNameE911Override]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameE911Override error:&error]; } @end diff --git a/SmartDeviceLink/SDLNavigationCapability.m b/SmartDeviceLink/SDLNavigationCapability.m index 11ef43f6f..61181dc51 100644 --- a/SmartDeviceLink/SDLNavigationCapability.m +++ b/SmartDeviceLink/SDLNavigationCapability.m @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber *)sendLocationEnabled { - return [store sdl_objectForName:SDLRPCParameterNameSendLocationEnabled]; + return [store sdl_objectForName:SDLRPCParameterNameSendLocationEnabled ofClass:NSNumber.class]; } - (void)setGetWayPointsEnabled:(nullable NSNumber *)getWayPointsEnabled { @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber *)getWayPointsEnabled { - return [store sdl_objectForName:SDLRPCParameterNameGetWayPointsEnabled]; + return [store sdl_objectForName:SDLRPCParameterNameGetWayPointsEnabled ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLNavigationInstruction.m b/SmartDeviceLink/SDLNavigationInstruction.m index 791974c23..396d76425 100644 --- a/SmartDeviceLink/SDLNavigationInstruction.m +++ b/SmartDeviceLink/SDLNavigationInstruction.m @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLNavigationAction)action { - return [store sdl_objectForName:SDLRPCParameterNameAction]; + return [store sdl_enumForName:SDLRPCParameterNameAction error:nil]; } - (void)setEta:(nullable SDLDateTime *)eta { @@ -76,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)bearing { - return [store sdl_objectForName:SDLRPCParameterNameBearing]; + return [store sdl_objectForName:SDLRPCParameterNameBearing ofClass:NSNumber.class]; } - (void)setJunctionType:(nullable SDLNavigationJunction)junctionType { @@ -84,7 +84,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLNavigationJunction)junctionType { - return [store sdl_objectForName:SDLRPCParameterNameJunctionType]; + return [store sdl_enumForName:SDLRPCParameterNameJunctionType error:nil]; } - (void)setDrivingSide:(nullable SDLDirection)drivingSide { @@ -92,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLDirection)drivingSide { - return [store sdl_objectForName:SDLRPCParameterNameDrivingSide]; + return [store sdl_enumForName:SDLRPCParameterNameDrivingSide error:nil]; } - (void)setDetails:(nullable NSString *)details { @@ -100,7 +100,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)details { - return [store sdl_objectForName:SDLRPCParameterNameDetails]; + return [store sdl_objectForName:SDLRPCParameterNameDetails ofClass:NSString.class]; } - (void)setImage:(nullable SDLImage *)image { diff --git a/SmartDeviceLink/SDLNavigationServiceData.m b/SmartDeviceLink/SDLNavigationServiceData.m index 1238e6b28..2f74bd2ca 100644 --- a/SmartDeviceLink/SDLNavigationServiceData.m +++ b/SmartDeviceLink/SDLNavigationServiceData.m @@ -100,7 +100,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)nextInstructionDistance { - return [store sdl_objectForName:SDLRPCParameterNameNextInstructionDistance]; + return [store sdl_objectForName:SDLRPCParameterNameNextInstructionDistance ofClass:NSNumber.class]; } - (void)setNextInstructionDistanceScale:(nullable NSNumber<SDLFloat> *)nextInstructionDistanceScale { @@ -108,7 +108,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)nextInstructionDistanceScale { - return [store sdl_objectForName:SDLRPCParameterNameNextInstructionDistanceScale]; + return [store sdl_objectForName:SDLRPCParameterNameNextInstructionDistanceScale ofClass:NSNumber.class]; } - (void)setPrompt:(nullable NSString *)prompt { @@ -116,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)prompt { - return [store sdl_objectForName:SDLRPCParameterNamePrompt]; + return [store sdl_objectForName:SDLRPCParameterNamePrompt ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLNavigationServiceManifest.m b/SmartDeviceLink/SDLNavigationServiceManifest.m index 9d9800c1c..17183cbd6 100644 --- a/SmartDeviceLink/SDLNavigationServiceManifest.m +++ b/SmartDeviceLink/SDLNavigationServiceManifest.m @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)acceptsWayPoints { - return [store sdl_objectForName:SDLRPCParameterNameAcceptsWayPoints]; + return [store sdl_objectForName:SDLRPCParameterNameAcceptsWayPoints ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLOasisAddress.m b/SmartDeviceLink/SDLOasisAddress.m index d1c7661be..bcb4438e9 100644 --- a/SmartDeviceLink/SDLOasisAddress.m +++ b/SmartDeviceLink/SDLOasisAddress.m @@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)countryName { - return [store sdl_objectForName:SDLRPCParameterNameCountryName]; + return [store sdl_objectForName:SDLRPCParameterNameCountryName ofClass:NSString.class]; } - (void)setCountryCode:(nullable NSString *)countryCode { @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)countryCode { - return [store sdl_objectForName:SDLRPCParameterNameCountryCode]; + return [store sdl_objectForName:SDLRPCParameterNameCountryCode ofClass:NSString.class]; } - (void)setPostalCode:(nullable NSString *)postalCode { @@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)postalCode { - return [store sdl_objectForName:SDLRPCParameterNamePostalCode]; + return [store sdl_objectForName:SDLRPCParameterNamePostalCode ofClass:NSString.class]; } - (void)setAdministrativeArea:(nullable NSString *)administrativeArea { @@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)administrativeArea { - return [store sdl_objectForName:SDLRPCParameterNameAdministrativeArea]; + return [store sdl_objectForName:SDLRPCParameterNameAdministrativeArea ofClass:NSString.class]; } - (void)setSubAdministrativeArea:(nullable NSString *)subAdministrativeArea { @@ -70,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)subAdministrativeArea { - return [store sdl_objectForName:SDLRPCParameterNameSubAdministrativeArea]; + return [store sdl_objectForName:SDLRPCParameterNameSubAdministrativeArea ofClass:NSString.class]; } - (void)setLocality:(nullable NSString *)locality { @@ -78,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)locality { - return [store sdl_objectForName:SDLRPCParameterNameLocality]; + return [store sdl_objectForName:SDLRPCParameterNameLocality ofClass:NSString.class]; } - (void)setSubLocality:(nullable NSString *)subLocality { @@ -86,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)subLocality { - return [store sdl_objectForName:SDLRPCParameterNameSubLocality]; + return [store sdl_objectForName:SDLRPCParameterNameSubLocality ofClass:NSString.class]; } - (void)setThoroughfare:(nullable NSString *)thoroughfare { @@ -94,7 +94,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)thoroughfare { - return [store sdl_objectForName:SDLRPCParameterNameThoroughfare]; + return [store sdl_objectForName:SDLRPCParameterNameThoroughfare ofClass:NSString.class]; } - (void)setSubThoroughfare:(nullable NSString *)subThoroughfare { @@ -102,7 +102,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)subThoroughfare { - return [store sdl_objectForName:SDLRPCParameterNameSubThoroughfare]; + return [store sdl_objectForName:SDLRPCParameterNameSubThoroughfare ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLOnAppInterfaceUnregistered.m b/SmartDeviceLink/SDLOnAppInterfaceUnregistered.m index e832dc58f..b0109c2a2 100644 --- a/SmartDeviceLink/SDLOnAppInterfaceUnregistered.m +++ b/SmartDeviceLink/SDLOnAppInterfaceUnregistered.m @@ -22,7 +22,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLAppInterfaceUnregisteredReason)reason { - return [parameters sdl_objectForName:SDLRPCParameterNameReason]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameReason error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnButtonEvent.m b/SmartDeviceLink/SDLOnButtonEvent.m index 7aa316f4d..1f78c9593 100644 --- a/SmartDeviceLink/SDLOnButtonEvent.m +++ b/SmartDeviceLink/SDLOnButtonEvent.m @@ -22,8 +22,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLButtonName)buttonName { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameButtonName]; - return (SDLButtonName)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameButtonName error:&error]; } - (void)setButtonEventMode:(SDLButtonEventMode)buttonEventMode { @@ -31,8 +31,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLButtonEventMode)buttonEventMode { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameButtonEventMode]; - return (SDLButtonEventMode)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameButtonEventMode error:&error]; } - (void)setCustomButtonID:(nullable NSNumber<SDLInt> *)customButtonID { @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)customButtonID { - return [parameters sdl_objectForName:SDLRPCParameterNameCustomButtonId]; + return [parameters sdl_objectForName:SDLRPCParameterNameCustomButtonId ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLOnButtonPress.m b/SmartDeviceLink/SDLOnButtonPress.m index a05a246fd..ce519be20 100644 --- a/SmartDeviceLink/SDLOnButtonPress.m +++ b/SmartDeviceLink/SDLOnButtonPress.m @@ -22,8 +22,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLButtonName)buttonName { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameButtonName]; - return (SDLButtonName)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameButtonName error:&error]; } - (void)setButtonPressMode:(SDLButtonPressMode)buttonPressMode { @@ -31,8 +31,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLButtonPressMode)buttonPressMode { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameButtonPressMode]; - return (SDLButtonPressMode)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameButtonPressMode error:&error]; } - (void)setCustomButtonID:(nullable NSNumber<SDLInt> *)customButtonID { @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)customButtonID { - return [parameters sdl_objectForName:SDLRPCParameterNameCustomButtonId]; + return [parameters sdl_objectForName:SDLRPCParameterNameCustomButtonId ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLOnCommand.m b/SmartDeviceLink/SDLOnCommand.m index 879850566..19b41c25d 100644 --- a/SmartDeviceLink/SDLOnCommand.m +++ b/SmartDeviceLink/SDLOnCommand.m @@ -22,7 +22,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)cmdID { - return [parameters sdl_objectForName:SDLRPCParameterNameCommandId]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameCommandId ofClass:NSNumber.class error:&error]; } - (void)setTriggerSource:(SDLTriggerSource)triggerSource { @@ -30,8 +31,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLTriggerSource)triggerSource { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameTriggerSource]; - return (SDLTriggerSource)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameTriggerSource error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnDriverDistraction.m b/SmartDeviceLink/SDLOnDriverDistraction.m index 744d8521d..502e0b57d 100644 --- a/SmartDeviceLink/SDLOnDriverDistraction.m +++ b/SmartDeviceLink/SDLOnDriverDistraction.m @@ -23,8 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLDriverDistractionState)state { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameState]; - return (SDLDriverDistractionState)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameState error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnEncodedSyncPData.m b/SmartDeviceLink/SDLOnEncodedSyncPData.m index 794047a6a..c5b8c349b 100644 --- a/SmartDeviceLink/SDLOnEncodedSyncPData.m +++ b/SmartDeviceLink/SDLOnEncodedSyncPData.m @@ -22,7 +22,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<NSString *> *)data { - return [parameters sdl_objectForName:SDLRPCParameterNameData]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameData ofClass:NSString.class error:&error]; } - (void)setURL:(nullable NSString *)URL { @@ -30,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)URL { - return [parameters sdl_objectForName:SDLRPCParameterNameURLUppercase]; + return [parameters sdl_objectForName:SDLRPCParameterNameURLUppercase ofClass:NSString.class]; } - (void)setTimeout:(nullable NSNumber<SDLInt> *)Timeout { @@ -38,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)Timeout { - return [parameters sdl_objectForName:SDLRPCParameterNameTimeoutCapitalized]; + return [parameters sdl_objectForName:SDLRPCParameterNameTimeoutCapitalized ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLOnHMIStatus.m b/SmartDeviceLink/SDLOnHMIStatus.m index 212d29304..128be1c8e 100644 --- a/SmartDeviceLink/SDLOnHMIStatus.m +++ b/SmartDeviceLink/SDLOnHMIStatus.m @@ -25,8 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLHMILevel)hmiLevel { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameHMILevel]; - return (SDLHMILevel)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameHMILevel error:&error]; } - (void)setAudioStreamingState:(SDLAudioStreamingState)audioStreamingState { @@ -34,8 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLAudioStreamingState)audioStreamingState { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameAudioStreamingState]; - return (SDLAudioStreamingState)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameAudioStreamingState error:&error]; } - (void)setVideoStreamingState:(nullable SDLVideoStreamingState)videoStreamingState { @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVideoStreamingState)videoStreamingState { - return [parameters sdl_objectForName:SDLRPCParameterNameVideoStreamingState]; + return [parameters sdl_enumForName:SDLRPCParameterNameVideoStreamingState error:nil]; } - (void)setSystemContext:(SDLSystemContext)systemContext { @@ -51,8 +51,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSystemContext)systemContext { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameSystemContext]; - return (SDLSystemContext)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameSystemContext error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnHashChange.m b/SmartDeviceLink/SDLOnHashChange.m index 49cb824e4..bd00ada7e 100644 --- a/SmartDeviceLink/SDLOnHashChange.m +++ b/SmartDeviceLink/SDLOnHashChange.m @@ -23,7 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)hashID { - return [parameters sdl_objectForName:SDLRPCParameterNameHashId]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameHashId ofClass:NSString.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnInteriorVehicleData.m b/SmartDeviceLink/SDLOnInteriorVehicleData.m index 3fde97e35..e675ebb2e 100644 --- a/SmartDeviceLink/SDLOnInteriorVehicleData.m +++ b/SmartDeviceLink/SDLOnInteriorVehicleData.m @@ -23,7 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLModuleData *)moduleData { - return [parameters sdl_objectForName:SDLRPCParameterNameModuleData ofClass:SDLModuleData.class]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameModuleData ofClass:SDLModuleData.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnKeyboardInput.m b/SmartDeviceLink/SDLOnKeyboardInput.m index a10cae0c1..e49c5977e 100644 --- a/SmartDeviceLink/SDLOnKeyboardInput.m +++ b/SmartDeviceLink/SDLOnKeyboardInput.m @@ -22,8 +22,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLKeyboardEvent)event { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameEvent]; - return (SDLKeyboardEvent)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameEvent error:&error]; } - (void)setData:(nullable NSString *)data { @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)data { - return [parameters sdl_objectForName:SDLRPCParameterNameData]; + return [parameters sdl_objectForName:SDLRPCParameterNameData ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLOnLanguageChange.m b/SmartDeviceLink/SDLOnLanguageChange.m index a2e65df55..cccfbb55f 100644 --- a/SmartDeviceLink/SDLOnLanguageChange.m +++ b/SmartDeviceLink/SDLOnLanguageChange.m @@ -23,8 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLLanguage)language { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameLanguage]; - return (SDLLanguage)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameLanguage error:&error]; } - (void)setHmiDisplayLanguage:(SDLLanguage)hmiDisplayLanguage { @@ -32,8 +32,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLLanguage)hmiDisplayLanguage { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameHMIDisplayLanguage]; - return (SDLLanguage)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameHMIDisplayLanguage error:&error]; } diff --git a/SmartDeviceLink/SDLOnLockScreenStatus.m b/SmartDeviceLink/SDLOnLockScreenStatus.m index 4c567d34a..b29cc07db 100644 --- a/SmartDeviceLink/SDLOnLockScreenStatus.m +++ b/SmartDeviceLink/SDLOnLockScreenStatus.m @@ -26,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLLockScreenStatus)lockScreenStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameOnLockScreenStatus]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameOnLockScreenStatus error:&error]; } - (void)setHmiLevel:(SDLHMILevel)hmiLevel { @@ -34,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLHMILevel)hmiLevel { - return [parameters sdl_objectForName:SDLRPCParameterNameHMILevel]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameHMILevel error:&error]; } - (void)setUserSelected:(NSNumber<SDLBool> *)userSelected { @@ -42,7 +44,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)userSelected { - return [parameters sdl_objectForName:SDLRPCParameterNameUserSelected]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameUserSelected ofClass:NSNumber.class error:&error]; } - (void)setDriverDistractionStatus:(NSNumber<SDLBool> *)driverDistractionStatus { @@ -50,7 +53,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)driverDistractionStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameDriverDistractionStatus]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameDriverDistractionStatus ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnPermissionsChange.m b/SmartDeviceLink/SDLOnPermissionsChange.m index 6da23be6f..dae1ffddb 100644 --- a/SmartDeviceLink/SDLOnPermissionsChange.m +++ b/SmartDeviceLink/SDLOnPermissionsChange.m @@ -23,7 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLPermissionItem *> *)permissionItem { - return [parameters sdl_objectsForName:SDLRPCParameterNamePermissionItem ofClass:SDLPermissionItem.class]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNamePermissionItem ofClass:SDLPermissionItem.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnRCStatus.m b/SmartDeviceLink/SDLOnRCStatus.m index 69050f352..1dc620d16 100644 --- a/SmartDeviceLink/SDLOnRCStatus.m +++ b/SmartDeviceLink/SDLOnRCStatus.m @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)allowed { - return [parameters sdl_objectForName:SDLRPCParameterNameAllowed]; + return [parameters sdl_objectForName:SDLRPCParameterNameAllowed ofClass:NSNumber.class]; } - (void)setAllowed:(nullable NSNumber<SDLBool> *)allowed { @@ -32,7 +32,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLModuleData *> *)allocatedModules { - return [parameters sdl_objectsForName:SDLRPCParameterNameAllocatedModules ofClass:SDLModuleData.class]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameAllocatedModules ofClass:SDLModuleData.class error:&error]; } - (void)setFreeModules:(NSArray<SDLModuleData *> *)freeModules { @@ -40,7 +41,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLModuleData *> *)freeModules { - return [parameters sdl_objectsForName:SDLRPCParameterNameFreeModules ofClass:SDLModuleData.class]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameFreeModules ofClass:SDLModuleData.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnSyncPData.m b/SmartDeviceLink/SDLOnSyncPData.m index aa1f843bb..4c6504a7c 100644 --- a/SmartDeviceLink/SDLOnSyncPData.m +++ b/SmartDeviceLink/SDLOnSyncPData.m @@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)URL { - return [parameters sdl_objectForName:SDLRPCParameterNameURLUppercase]; + return [parameters sdl_objectForName:SDLRPCParameterNameURLUppercase ofClass:NSString.class]; } - (void)setTimeout:(nullable NSNumber<SDLInt> *)Timeout { @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)Timeout { - return [parameters sdl_objectForName:SDLRPCParameterNameTimeoutCapitalized]; + return [parameters sdl_objectForName:SDLRPCParameterNameTimeoutCapitalized ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLOnSystemRequest.m b/SmartDeviceLink/SDLOnSystemRequest.m index d0af59d8e..56862f367 100644 --- a/SmartDeviceLink/SDLOnSystemRequest.m +++ b/SmartDeviceLink/SDLOnSystemRequest.m @@ -22,7 +22,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLRequestType)requestType { - return [parameters sdl_objectForName:SDLRPCParameterNameRequestType]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameRequestType error:&error]; } - (void)setRequestSubType:(nullable NSString *)requestSubType { @@ -30,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)requestSubType { - return [parameters sdl_objectForName:SDLRPCParameterNameRequestSubType]; + return [parameters sdl_objectForName:SDLRPCParameterNameRequestSubType ofClass:NSString.class]; } - (void)setUrl:(nullable NSString *)url { @@ -38,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)url { - return [parameters sdl_objectForName:SDLRPCParameterNameURL]; + return [parameters sdl_objectForName:SDLRPCParameterNameURL ofClass:NSString.class]; } - (void)setTimeout:(nullable NSNumber<SDLInt> *)timeout { @@ -46,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)timeout { - return [parameters sdl_objectForName:SDLRPCParameterNameTimeout]; + return [parameters sdl_objectForName:SDLRPCParameterNameTimeout ofClass:NSNumber.class]; } - (void)setFileType:(nullable SDLFileType)fileType { @@ -54,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLFileType)fileType { - return [parameters sdl_objectForName:SDLRPCParameterNameFileType]; + return [parameters sdl_enumForName:SDLRPCParameterNameFileType error:nil]; } - (void)setOffset:(nullable NSNumber<SDLInt> *)offset { @@ -62,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)offset { - return [parameters sdl_objectForName:SDLRPCParameterNameOffset]; + return [parameters sdl_objectForName:SDLRPCParameterNameOffset ofClass:NSNumber.class]; } - (void)setLength:(nullable NSNumber<SDLInt> *)length { @@ -70,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)length { - return [parameters sdl_objectForName:SDLRPCParameterNameLength]; + return [parameters sdl_objectForName:SDLRPCParameterNameLength ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLOnTBTClientState.m b/SmartDeviceLink/SDLOnTBTClientState.m index 443d86cf6..a6392c472 100644 --- a/SmartDeviceLink/SDLOnTBTClientState.m +++ b/SmartDeviceLink/SDLOnTBTClientState.m @@ -22,8 +22,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLTBTState)state { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameState]; - return (SDLTBTState)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameState error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnTouchEvent.m b/SmartDeviceLink/SDLOnTouchEvent.m index 1abe8e284..0eb4bc09d 100644 --- a/SmartDeviceLink/SDLOnTouchEvent.m +++ b/SmartDeviceLink/SDLOnTouchEvent.m @@ -23,8 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLTouchType)type { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameType]; - return (SDLTouchType)obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameType error:&error]; } - (void)setEvent:(NSArray<SDLTouchEvent *> *)event { @@ -32,7 +32,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLTouchEvent *> *)event { - return [parameters sdl_objectsForName:SDLRPCParameterNameEvent ofClass:SDLTouchEvent.class]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameEvent ofClass:SDLTouchEvent.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLOnVehicleData.m b/SmartDeviceLink/SDLOnVehicleData.m index 64d1c8595..44d553f8d 100644 --- a/SmartDeviceLink/SDLOnVehicleData.m +++ b/SmartDeviceLink/SDLOnVehicleData.m @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)speed { - return [parameters sdl_objectForName:SDLRPCParameterNameSpeed]; + return [parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class]; } - (void)setRpm:(nullable NSNumber<SDLInt> *)rpm { @@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)rpm { - return [parameters sdl_objectForName:SDLRPCParameterNameRPM]; + return [parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class]; } - (void)setFuelLevel:(nullable NSNumber<SDLFloat> *)fuelLevel { @@ -58,7 +58,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)fuelLevel { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevel]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class]; } - (void)setFuelLevel_State:(nullable SDLComponentVolumeStatus)fuelLevel_State { @@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLComponentVolumeStatus)fuelLevel_State { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState]; + return [parameters sdl_enumForName:SDLRPCParameterNameFuelLevelState error:nil]; } - (void)setFuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange { @@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)instantFuelConsumption { - return [parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption]; + return [parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class]; } - (void)setExternalTemperature:(nullable NSNumber<SDLFloat> *)externalTemperature { @@ -90,7 +90,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)externalTemperature { - return [parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature]; + return [parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class]; } - (void)setVin:(nullable NSString *)vin { @@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)vin { - return [parameters sdl_objectForName:SDLRPCParameterNameVIN]; + return [parameters sdl_objectForName:SDLRPCParameterNameVIN ofClass:NSString.class]; } - (void)setPrndl:(nullable SDLPRNDL)prndl { @@ -106,8 +106,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLPRNDL)prndl { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNamePRNDL]; - return (SDLPRNDL)obj; + return [parameters sdl_enumForName:SDLRPCParameterNamePRNDL error:nil]; } - (void)setTirePressure:(nullable SDLTireStatus *)tirePressure { @@ -123,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)odometer { - return [parameters sdl_objectForName:SDLRPCParameterNameOdometer]; + return [parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class]; } - (void)setBeltStatus:(nullable SDLBeltStatus *)beltStatus { @@ -155,7 +154,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataEventStatus)driverBraking { - return [parameters sdl_objectForName:SDLRPCParameterNameDriverBraking]; + return [parameters sdl_enumForName:SDLRPCParameterNameDriverBraking error:nil]; } - (void)setWiperStatus:(nullable SDLWiperStatus)wiperStatus { @@ -163,7 +162,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLWiperStatus)wiperStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameWiperStatus]; + return [parameters sdl_enumForName:SDLRPCParameterNameWiperStatus error:nil]; } - (void)setHeadLampStatus:(nullable SDLHeadLampStatus *)headLampStatus { @@ -179,7 +178,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)engineOilLife { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class]; } - (void)setEngineTorque:(nullable NSNumber<SDLFloat> *)engineTorque { @@ -187,7 +186,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)engineTorque { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineTorque]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class]; } - (void)setAccPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition { @@ -195,7 +194,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)accPedalPosition { - return [parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition]; + return [parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class]; } - (void)setSteeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle { @@ -203,7 +202,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)steeringWheelAngle { - return [parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle]; + return [parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class]; } - (void)setECallInfo:(nullable SDLECallInfo *)eCallInfo { @@ -251,7 +250,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus]; + return [parameters sdl_enumForName:SDLRPCParameterNameElectronicParkBrakeStatus error:nil]; } - (void)setTurnSignal:(nullable SDLTurnSignal)turnSignal { @@ -259,7 +258,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLTurnSignal)turnSignal { - return [parameters sdl_objectForName:SDLRPCParameterNameTurnSignal]; + return [parameters sdl_enumForName:SDLRPCParameterNameTurnSignal error:nil]; } @end diff --git a/SmartDeviceLink/SDLOnWayPointChange.m b/SmartDeviceLink/SDLOnWayPointChange.m index 5e2c93d42..a2df4addb 100644 --- a/SmartDeviceLink/SDLOnWayPointChange.m +++ b/SmartDeviceLink/SDLOnWayPointChange.m @@ -23,7 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLLocationDetails *> *)waypoints { - return [parameters sdl_objectsForName:SDLRPCParameterNameWayPoints ofClass:SDLLocationDetails.class]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameWayPoints ofClass:SDLLocationDetails.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLParameterPermissions.m b/SmartDeviceLink/SDLParameterPermissions.m index aab3f77e7..ecbcc7a5d 100644 --- a/SmartDeviceLink/SDLParameterPermissions.m +++ b/SmartDeviceLink/SDLParameterPermissions.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<NSString *> *)allowed { - return [store sdl_objectForName:SDLRPCParameterNameAllowed]; + NSError *error; + return [store sdl_objectsForName:SDLRPCParameterNameAllowed ofClass:NSString.class error:&error]; } - (void)setUserDisallowed:(NSArray<NSString *> *)userDisallowed { @@ -24,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<NSString *> *)userDisallowed { - return [store sdl_objectForName:SDLRPCParameterNameUserDisallowed]; + NSError *error; + return [store sdl_objectsForName:SDLRPCParameterNameUserDisallowed ofClass:NSString.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLPerformAppServiceInteraction.m b/SmartDeviceLink/SDLPerformAppServiceInteraction.m index ccbd0293e..58a568d54 100644 --- a/SmartDeviceLink/SDLPerformAppServiceInteraction.m +++ b/SmartDeviceLink/SDLPerformAppServiceInteraction.m @@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)serviceUri { - return [parameters sdl_objectForName:SDLRPCParameterNameServiceUri]; + return [parameters sdl_objectForName:SDLRPCParameterNameServiceUri ofClass:NSString.class]; } - (void)setServiceID:(NSString *)serviceID { @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)serviceID { - return [parameters sdl_objectForName:SDLRPCParameterNameServiceID]; + return [parameters sdl_objectForName:SDLRPCParameterNameServiceID ofClass:NSString.class]; } - (void)setOriginApp:(NSString *)originApp { @@ -68,7 +68,7 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)originApp { - return [parameters sdl_objectForName:SDLRPCParameterNameOriginApp]; + return [parameters sdl_objectForName:SDLRPCParameterNameOriginApp ofClass:NSString.class]; } - (void)setRequestServiceActive:(nullable NSNumber<SDLBool> *)requestServiceActive { @@ -76,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)requestServiceActive { - return [parameters sdl_objectForName:SDLRPCParameterNameRequestServiceActive]; + return [parameters sdl_objectForName:SDLRPCParameterNameRequestServiceActive ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLPerformAppServiceInteractionResponse.m b/SmartDeviceLink/SDLPerformAppServiceInteractionResponse.m index 77c95a240..3b4ff5e07 100644 --- a/SmartDeviceLink/SDLPerformAppServiceInteractionResponse.m +++ b/SmartDeviceLink/SDLPerformAppServiceInteractionResponse.m @@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)serviceSpecificResult { - return [parameters sdl_objectForName:SDLRPCParameterNameServiceSpecificResult]; + return [parameters sdl_objectForName:SDLRPCParameterNameServiceSpecificResult ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLPerformAudioPassThru.m b/SmartDeviceLink/SDLPerformAudioPassThru.m index 5a90481db..6b300905e 100644 --- a/SmartDeviceLink/SDLPerformAudioPassThru.m +++ b/SmartDeviceLink/SDLPerformAudioPassThru.m @@ -70,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)audioPassThruDisplayText1 { - return [parameters sdl_objectForName:SDLRPCParameterNameAudioPassThruDisplayText1]; + return [parameters sdl_objectForName:SDLRPCParameterNameAudioPassThruDisplayText1 ofClass:NSString.class]; } - (void)setAudioPassThruDisplayText2:(nullable NSString *)audioPassThruDisplayText2 { @@ -78,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)audioPassThruDisplayText2 { - return [parameters sdl_objectForName:SDLRPCParameterNameAudioPassThruDisplayText2]; + return [parameters sdl_objectForName:SDLRPCParameterNameAudioPassThruDisplayText2 ofClass:NSString.class]; } - (void)setSamplingRate:(SDLSamplingRate)samplingRate { @@ -86,8 +86,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSamplingRate)samplingRate { - NSObject *obj = [parameters sdl_objectForName:SDLRPCParameterNameSamplingRate]; - return (SDLSamplingRate )obj; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameSamplingRate error:&error]; } - (void)setMaxDuration:(NSNumber<SDLInt> *)maxDuration { @@ -95,7 +95,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)maxDuration { - return [parameters sdl_objectForName:SDLRPCParameterNameMaxDuration]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameMaxDuration ofClass:NSNumber.class error:&error]; } - (void)setBitsPerSample:(SDLBitsPerSample)bitsPerSample { @@ -103,7 +104,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLBitsPerSample)bitsPerSample { - return [parameters sdl_objectForName:SDLRPCParameterNameBitsPerSample]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameBitsPerSample error:&error]; } - (void)setAudioType:(SDLAudioType)audioType { @@ -111,7 +113,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLAudioType)audioType { - return [parameters sdl_objectForName:SDLRPCParameterNameAudioType]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameAudioType error:&error]; } - (void)setMuteAudio:(nullable NSNumber<SDLBool> *)muteAudio { @@ -119,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)muteAudio { - return [parameters sdl_objectForName:SDLRPCParameterNameMuteAudio]; + return [parameters sdl_objectForName:SDLRPCParameterNameMuteAudio ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLPerformInteraction.m b/SmartDeviceLink/SDLPerformInteraction.m index 4754ebaec..581694608 100644 --- a/SmartDeviceLink/SDLPerformInteraction.m +++ b/SmartDeviceLink/SDLPerformInteraction.m @@ -96,7 +96,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)initialText { - return [parameters sdl_objectForName:SDLRPCParameterNameInitialText]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameInitialText ofClass:NSString.class error:&error]; } - (void)setInitialPrompt:(nullable NSArray<SDLTTSChunk *> *)initialPrompt { @@ -112,7 +113,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLInteractionMode)interactionMode { - return [parameters sdl_objectForName:SDLRPCParameterNameInteractionMode]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameInteractionMode error:&error]; } - (void)setInteractionChoiceSetIDList:(NSArray<NSNumber<SDLInt> *> *)interactionChoiceSetIDList { @@ -120,7 +122,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<NSNumber<SDLInt> *> *)interactionChoiceSetIDList { - return [parameters sdl_objectForName:SDLRPCParameterNameInteractionChoiceSetIdList]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameInteractionChoiceSetIdList ofClass:NSNumber.class error:&error]; } - (void)setHelpPrompt:(nullable NSArray<SDLTTSChunk *> *)helpPrompt { @@ -144,7 +147,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)timeout { - return [parameters sdl_objectForName:SDLRPCParameterNameTimeout]; + return [parameters sdl_objectForName:SDLRPCParameterNameTimeout ofClass:NSNumber.class]; } - (void)setVrHelp:(nullable NSArray<SDLVRHelpItem *> *)vrHelp { @@ -160,7 +163,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLLayoutMode)interactionLayout { - return [parameters sdl_objectForName:SDLRPCParameterNameInteractionLayout]; + return [parameters sdl_enumForName:SDLRPCParameterNameInteractionLayout error:nil]; } @end diff --git a/SmartDeviceLink/SDLPerformInteractionResponse.m b/SmartDeviceLink/SDLPerformInteractionResponse.m index 71479be9a..78c7c1a6a 100644 --- a/SmartDeviceLink/SDLPerformInteractionResponse.m +++ b/SmartDeviceLink/SDLPerformInteractionResponse.m @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)choiceID { - return [parameters sdl_objectForName:SDLRPCParameterNameChoiceId]; + return [parameters sdl_objectForName:SDLRPCParameterNameChoiceId ofClass:NSNumber.class]; } - (void)setManualTextEntry:(nullable NSString *)manualTextEntry { @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)manualTextEntry { - return [parameters sdl_objectForName:SDLRPCParameterNameManualTextEntry]; + return [parameters sdl_objectForName:SDLRPCParameterNameManualTextEntry ofClass:NSString.class]; } - (void)setTriggerSource:(nullable SDLTriggerSource)triggerSource { @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLTriggerSource)triggerSource { - return [parameters sdl_objectForName:SDLRPCParameterNameTriggerSource]; + return [parameters sdl_enumForName:SDLRPCParameterNameTriggerSource error:nil]; } @end diff --git a/SmartDeviceLink/SDLPermissionItem.m b/SmartDeviceLink/SDLPermissionItem.m index 5e9b950d0..687e43a8b 100644 --- a/SmartDeviceLink/SDLPermissionItem.m +++ b/SmartDeviceLink/SDLPermissionItem.m @@ -17,7 +17,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)rpcName { - return [store sdl_objectForName:SDLRPCParameterNameRPCName]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameRPCName ofClass:NSString.class error:&error]; } - (void)setHmiPermissions:(SDLHMIPermissions *)hmiPermissions { @@ -25,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLHMIPermissions *)hmiPermissions { - return [store sdl_objectForName:SDLRPCParameterNameHMIPermissions ofClass:SDLHMIPermissions.class]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameHMIPermissions ofClass:SDLHMIPermissions.class error:&error]; } - (void)setParameterPermissions:(SDLParameterPermissions *)parameterPermissions { @@ -33,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLParameterPermissions *)parameterPermissions { - return [store sdl_objectForName:SDLRPCParameterNameParameterPermissions ofClass:SDLParameterPermissions.class]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameParameterPermissions ofClass:SDLParameterPermissions.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLPhoneCapability.m b/SmartDeviceLink/SDLPhoneCapability.m index f1f88dcdb..8547af230 100644 --- a/SmartDeviceLink/SDLPhoneCapability.m +++ b/SmartDeviceLink/SDLPhoneCapability.m @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber *)dialNumberEnabled { - return [store sdl_objectForName:SDLRPCParameterNameDialNumberEnabled]; + return [store sdl_objectForName:SDLRPCParameterNameDialNumberEnabled ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLPresetBankCapabilities.m b/SmartDeviceLink/SDLPresetBankCapabilities.m index f767c3c30..d3c3c184a 100644 --- a/SmartDeviceLink/SDLPresetBankCapabilities.m +++ b/SmartDeviceLink/SDLPresetBankCapabilities.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)onScreenPresetsAvailable { - return [store sdl_objectForName:SDLRPCParameterNameOnScreenPresetsAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameOnScreenPresetsAvailable ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLPutFile.m b/SmartDeviceLink/SDLPutFile.m index d8662c40c..29627ec93 100644 --- a/SmartDeviceLink/SDLPutFile.m +++ b/SmartDeviceLink/SDLPutFile.m @@ -88,7 +88,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)syncFileName { - return [parameters sdl_objectForName:SDLRPCParameterNameSyncFileName]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameSyncFileName ofClass:NSString.class error:&error]; } - (void)setFileType:(SDLFileType)fileType { @@ -96,7 +97,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLFileType)fileType { - return [parameters sdl_objectForName:SDLRPCParameterNameFileType]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameFileType error:&error]; } - (void)setPersistentFile:(nullable NSNumber<SDLBool> *)persistentFile { @@ -104,7 +106,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)persistentFile { - return [parameters sdl_objectForName:SDLRPCParameterNamePersistentFile]; + return [parameters sdl_objectForName:SDLRPCParameterNamePersistentFile ofClass:NSNumber.class]; } - (void)setSystemFile:(nullable NSNumber<SDLBool> *)systemFile { @@ -112,7 +114,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)systemFile { - return [parameters sdl_objectForName:SDLRPCParameterNameSystemFile]; + return [parameters sdl_objectForName:SDLRPCParameterNameSystemFile ofClass:NSNumber.class]; } - (void)setOffset:(nullable NSNumber<SDLUInt> *)offset { @@ -120,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLUInt> *)offset { - return [parameters sdl_objectForName:SDLRPCParameterNameOffset]; + return [parameters sdl_objectForName:SDLRPCParameterNameOffset ofClass:NSNumber.class]; } - (void)setLength:(nullable NSNumber<SDLUInt> *)length { @@ -128,7 +130,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLUInt> *)length { - return [parameters sdl_objectForName:SDLRPCParameterNameLength]; + return [parameters sdl_objectForName:SDLRPCParameterNameLength ofClass:NSNumber.class]; } - (void)setCrc:(nullable NSNumber<SDLUInt> *)crc { @@ -136,7 +138,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLUInt> *)crc { - return [parameters sdl_objectForName:SDLRPCParameterNameCRC]; + return [parameters sdl_objectForName:SDLRPCParameterNameCRC ofClass:NSNumber.class]; } #pragma mark - Helpers diff --git a/SmartDeviceLink/SDLPutFileResponse.m b/SmartDeviceLink/SDLPutFileResponse.m index cdf6add9a..735cce6c7 100644 --- a/SmartDeviceLink/SDLPutFileResponse.m +++ b/SmartDeviceLink/SDLPutFileResponse.m @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)spaceAvailable { - return [parameters sdl_objectForName:SDLRPCParameterNameSpaceAvailable]; + return [parameters sdl_objectForName:SDLRPCParameterNameSpaceAvailable ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLRDSData.m b/SmartDeviceLink/SDLRDSData.m index 98d42015a..4a5664daa 100755 --- a/SmartDeviceLink/SDLRDSData.m +++ b/SmartDeviceLink/SDLRDSData.m @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)programService { - return [store sdl_objectForName:SDLRPCParameterNameProgramService]; + return [store sdl_objectForName:SDLRPCParameterNameProgramService ofClass:NSString.class]; } - (void)setRadioText:(nullable NSString *)radioText { @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)radioText { - return [store sdl_objectForName:SDLRPCParameterNameRadioText]; + return [store sdl_objectForName:SDLRPCParameterNameRadioText ofClass:NSString.class]; } - (void)setClockText:(nullable NSString *)clockText { @@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)clockText { - return [store sdl_objectForName:SDLRPCParameterNameClockText]; + return [store sdl_objectForName:SDLRPCParameterNameClockText ofClass:NSString.class]; } - (void)setProgramIdentification:(nullable NSString *)programIdentification { @@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)programIdentification { - return [store sdl_objectForName:SDLRPCParameterNameProgramIdentification]; + return [store sdl_objectForName:SDLRPCParameterNameProgramIdentification ofClass:NSString.class]; } - (void)setProgramType:(nullable NSNumber<SDLInt> *)programType { @@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)programType { - return [store sdl_objectForName:SDLRPCParameterNameProgramType]; + return [store sdl_objectForName:SDLRPCParameterNameProgramType ofClass:NSNumber.class]; } - (void)setTrafficProgramIdentification:(nullable NSNumber<SDLBool> *)trafficProgramIdentification { @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)trafficProgramIdentification { - return [store sdl_objectForName:SDLRPCParameterNameTrafficProgramIdentification]; + return [store sdl_objectForName:SDLRPCParameterNameTrafficProgramIdentification ofClass:NSNumber.class]; } - (void)setTrafficAnnouncementIdentification:(nullable NSNumber<SDLBool> *)trafficAnnouncementIdentification { @@ -79,7 +79,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)trafficAnnouncementIdentification { - return [store sdl_objectForName:SDLRPCParameterNameTrafficAnnouncementIdentification]; + return [store sdl_objectForName:SDLRPCParameterNameTrafficAnnouncementIdentification ofClass:NSNumber.class]; } - (void)setRegion:(nullable NSString *)region { @@ -87,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)region { - return [store sdl_objectForName:SDLRPCParameterNameRegion]; + return [store sdl_objectForName:SDLRPCParameterNameRegion ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLRGBColor.m b/SmartDeviceLink/SDLRGBColor.m index 071908d4a..977675e32 100644 --- a/SmartDeviceLink/SDLRGBColor.m +++ b/SmartDeviceLink/SDLRGBColor.m @@ -45,7 +45,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)red { - return [store sdl_objectForName:SDLRPCParameterNameRed]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameRed ofClass:NSNumber.class error:&error]; } - (void)setGreen:(NSNumber<SDLInt> *)green { @@ -53,7 +54,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)green { - return [store sdl_objectForName:SDLRPCParameterNameGreen]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameGreen ofClass:NSNumber.class error:&error]; } - (void)setBlue:(NSNumber<SDLInt> *)blue { @@ -61,7 +63,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)blue { - return [store sdl_objectForName:SDLRPCParameterNameBlue]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameBlue ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLRPCMessage.m b/SmartDeviceLink/SDLRPCMessage.m index 56121b2c1..f8dfc3b9e 100644 --- a/SmartDeviceLink/SDLRPCMessage.m +++ b/SmartDeviceLink/SDLRPCMessage.m @@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)getFunctionName { - return [function sdl_objectForName:SDLRPCParameterNameOperationName]; + return [function sdl_objectForName:SDLRPCParameterNameOperationName ofClass:NSString.class]; } - (void)setFunctionName:(nullable NSString *)functionName { @@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSObject *)getParameters:(NSString *)functionName { - return [parameters sdl_objectForName:functionName]; + return [parameters sdl_objectForName:functionName ofClass:NSObject.class]; } - (void)setParameters:(NSString *)functionName value:(nullable NSObject *)value { diff --git a/SmartDeviceLink/SDLRPCRequest.m b/SmartDeviceLink/SDLRPCRequest.m index 1b5829b69..4e4916680 100644 --- a/SmartDeviceLink/SDLRPCRequest.m +++ b/SmartDeviceLink/SDLRPCRequest.m @@ -12,7 +12,8 @@ NS_ASSUME_NONNULL_BEGIN @implementation SDLRPCRequest - (NSNumber<SDLInt> *)correlationID { - return [function sdl_objectForName:SDLRPCParameterNameCorrelationId]; + NSError *error; + return [function sdl_objectForName:SDLRPCParameterNameCorrelationId ofClass:NSNumber.class error:&error]; } - (void)setCorrelationID:(NSNumber<SDLInt> *)corrID { diff --git a/SmartDeviceLink/SDLRPCResponse.m b/SmartDeviceLink/SDLRPCResponse.m index 6df0315d7..0bab8bdeb 100644 --- a/SmartDeviceLink/SDLRPCResponse.m +++ b/SmartDeviceLink/SDLRPCResponse.m @@ -37,7 +37,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)correlationID { - return [function sdl_objectForName:SDLRPCParameterNameCorrelationId]; + NSError *error; + return [function sdl_objectForName:SDLRPCParameterNameCorrelationId ofClass:NSNumber.class error:&error]; } - (void)setCorrelationID:(NSNumber<SDLInt> *)corrID { @@ -49,7 +50,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)success { - return [parameters sdl_objectForName:SDLRPCParameterNameSuccess]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameSuccess ofClass:NSNumber.class error:&error]; } - (void)setResultCode:(SDLResult)resultCode { @@ -57,7 +59,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLResult)resultCode { - return [parameters sdl_objectForName:SDLRPCParameterNameResultCode]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameResultCode error:&error]; } - (void)setInfo:(nullable NSString *)info { @@ -65,7 +68,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)info { - return [parameters sdl_objectForName:SDLRPCParameterNameInfo]; + return [parameters sdl_objectForName:SDLRPCParameterNameInfo ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLRadioControlCapabilities.m b/SmartDeviceLink/SDLRadioControlCapabilities.m index afb8bc3c1..93a842abc 100644 --- a/SmartDeviceLink/SDLRadioControlCapabilities.m +++ b/SmartDeviceLink/SDLRadioControlCapabilities.m @@ -42,7 +42,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)moduleName { - return [store sdl_objectForName:SDLRPCParameterNameModuleName]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameModuleName ofClass:NSString.class error:&error]; } - (void)setRadioEnableAvailable:(nullable NSNumber<SDLBool> *)radioEnableAvailable { @@ -50,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)radioEnableAvailable { - return [store sdl_objectForName:SDLRPCParameterNameRadioEnableAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameRadioEnableAvailable ofClass:NSNumber.class]; } - (void)setRadioBandAvailable:(nullable NSNumber<SDLBool> *)radioBandAvailable { @@ -58,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)radioBandAvailable { - return [store sdl_objectForName:SDLRPCParameterNameRadioBandAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameRadioBandAvailable ofClass:NSNumber.class]; } - (void)setRadioFrequencyAvailable:(nullable NSNumber<SDLBool> *)radioFrequencyAvailable { @@ -66,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)radioFrequencyAvailable { - return [store sdl_objectForName:SDLRPCParameterNameRadioFrequencyAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameRadioFrequencyAvailable ofClass:NSNumber.class]; } - (void)setHdChannelAvailable:(nullable NSNumber<SDLBool> *)hdChannelAvailable { @@ -74,7 +75,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)hdChannelAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHDChannelAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHDChannelAvailable ofClass:NSNumber.class]; } - (void)setRdsDataAvailable:(nullable NSNumber<SDLBool> *)rdsDataAvailable { @@ -82,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)rdsDataAvailable { - return [store sdl_objectForName:SDLRPCParameterNameRDSDataAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameRDSDataAvailable ofClass:NSNumber.class]; } - (void)setAvailableHDsAvailable:(nullable NSNumber<SDLBool> *)availableHDsAvailable { @@ -90,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)availableHDsAvailable { - return [store sdl_objectForName:SDLRPCParameterNameAvailableHDsAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameAvailableHDsAvailable ofClass:NSNumber.class]; } - (void)setStateAvailable:(nullable NSNumber<SDLBool> *)stateAvailable { @@ -98,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)stateAvailable { - return [store sdl_objectForName:SDLRPCParameterNameStateAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameStateAvailable ofClass:NSNumber.class]; } - (void)setSignalStrengthAvailable:(nullable NSNumber<SDLBool> *)signalStrengthAvailable { @@ -106,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)signalStrengthAvailable { - return [store sdl_objectForName:SDLRPCParameterNameSignalStrengthAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameSignalStrengthAvailable ofClass:NSNumber.class]; } - (void)setSignalChangeThresholdAvailable:(nullable NSNumber<SDLBool> *)signalChangeThresholdAvailable { @@ -114,7 +115,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)signalChangeThresholdAvailable { - return [store sdl_objectForName:SDLRPCParameterNameSignalChangeThresholdAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameSignalChangeThresholdAvailable ofClass:NSNumber.class]; } - (void)setHdRadioEnableAvailable:(nullable NSNumber<SDLBool> *)hdRadioEnableAvailable { @@ -122,7 +123,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)hdRadioEnableAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHDRadioEnableAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHDRadioEnableAvailable ofClass:NSNumber.class]; } - (void)setSiriusXMRadioAvailable:(nullable NSNumber<SDLBool> *)siriusXMRadioAvailable { @@ -130,7 +131,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)siriusXMRadioAvailable { - return [store sdl_objectForName:SDLRPCParameterNameSiriusXMRadioAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameSiriusXMRadioAvailable ofClass:NSNumber.class]; } - (void)setSisDataAvailable:(nullable NSNumber<SDLBool> *)sisDataAvailable { @@ -138,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)sisDataAvailable { - return [store sdl_objectForName:SDLRPCParameterNameSISDataAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameSISDataAvailable ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLRadioControlData.m b/SmartDeviceLink/SDLRadioControlData.m index 92bc8b60c..0ff04872f 100644 --- a/SmartDeviceLink/SDLRadioControlData.m +++ b/SmartDeviceLink/SDLRadioControlData.m @@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)frequencyInteger { - return [store sdl_objectForName:SDLRPCParameterNameFrequencyInteger]; + return [store sdl_objectForName:SDLRPCParameterNameFrequencyInteger ofClass:NSNumber.class]; } - (void)setFrequencyFraction:(nullable NSNumber<SDLInt> *)frequencyFraction { @@ -56,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)frequencyFraction { - return [store sdl_objectForName:SDLRPCParameterNameFrequencyFraction]; + return [store sdl_objectForName:SDLRPCParameterNameFrequencyFraction ofClass:NSNumber.class]; } - (void)setBand:(nullable SDLRadioBand)band { @@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLRadioBand)band{ - return [store sdl_objectForName:SDLRPCParameterNameBand]; + return [store sdl_enumForName:SDLRPCParameterNameBand error:nil]; } - (void)setRdsData:(nullable SDLRDSData *)rdsData { @@ -80,7 +80,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)availableHDs { - return [store sdl_objectForName:SDLRPCParameterNameAvailableHDs]; + return [store sdl_objectForName:SDLRPCParameterNameAvailableHDs ofClass:NSNumber.class]; } - (void)setHdChannel:(nullable NSNumber<SDLInt> *)hdChannel { @@ -88,7 +88,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)hdChannel { - return [store sdl_objectForName:SDLRPCParameterNameHDChannel]; + return [store sdl_objectForName:SDLRPCParameterNameHDChannel ofClass:NSNumber.class]; } - (void)setSignalStrength:(nullable NSNumber<SDLInt> *)signalStrength { @@ -96,7 +96,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)signalStrength { - return [store sdl_objectForName:SDLRPCParameterNameSignalStrength]; + return [store sdl_objectForName:SDLRPCParameterNameSignalStrength ofClass:NSNumber.class]; } - (void)setSignalChangeThreshold:(nullable NSNumber<SDLInt> *)signalChangeThreshold { @@ -104,7 +104,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)signalChangeThreshold { - return [store sdl_objectForName:SDLRPCParameterNameSignalChangeThreshold]; + return [store sdl_objectForName:SDLRPCParameterNameSignalChangeThreshold ofClass:NSNumber.class]; } - (void)setRadioEnable:(nullable NSNumber<SDLBool> *)radioEnable { @@ -112,7 +112,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)radioEnable { - return [store sdl_objectForName:SDLRPCParameterNameRadioEnable]; + return [store sdl_objectForName:SDLRPCParameterNameRadioEnable ofClass:NSNumber.class]; } - (void)setState:(nullable SDLRadioState)state { @@ -120,7 +120,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLRadioState)state { - return [store sdl_objectForName:SDLRPCParameterNameState]; + return [store sdl_enumForName:SDLRPCParameterNameState error:nil]; } - (void)setHdRadioEnable:(nullable NSNumber<SDLBool> *)hdRadioEnable { @@ -128,7 +128,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)hdRadioEnable { - return [store sdl_objectForName:SDLRPCParameterNameHDRadioEnable]; + return [store sdl_objectForName:SDLRPCParameterNameHDRadioEnable ofClass:NSNumber.class]; } - (void)setSisData:(nullable SDLSISData *)sisData { diff --git a/SmartDeviceLink/SDLReadDID.m b/SmartDeviceLink/SDLReadDID.m index 9e0013ce1..900ef7510 100644 --- a/SmartDeviceLink/SDLReadDID.m +++ b/SmartDeviceLink/SDLReadDID.m @@ -35,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)ecuName { - return [parameters sdl_objectForName:SDLRPCParameterNameECUName]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameECUName ofClass:NSNumber.class error:&error]; } - (void)setDidLocation:(NSArray<NSNumber<SDLInt> *> *)didLocation { @@ -43,7 +44,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<NSNumber<SDLInt> *> *)didLocation { - return [parameters sdl_objectForName:SDLRPCParameterNameDIDLocation]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameDIDLocation ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLRectangle.m b/SmartDeviceLink/SDLRectangle.m index 7434b098d..a05033b08 100644 --- a/SmartDeviceLink/SDLRectangle.m +++ b/SmartDeviceLink/SDLRectangle.m @@ -33,7 +33,8 @@ } - (NSNumber<SDLFloat> *)x { - return [store sdl_objectForName:SDLRPCParameterNameX]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameX ofClass:NSNumber.class error:&error]; } - (void)setY:(NSNumber<SDLFloat> *)y { @@ -41,7 +42,8 @@ } - (NSNumber<SDLFloat> *)y { - return [store sdl_objectForName:SDLRPCParameterNameY]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameY ofClass:NSNumber.class error:&error]; } - (void)setWidth:(NSNumber<SDLFloat> *)width { @@ -49,7 +51,8 @@ } - (NSNumber<SDLFloat> *)width { - return [store sdl_objectForName:SDLRPCParameterNameWidth]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameWidth ofClass:NSNumber.class error:&error]; } - (void)setHeight:(NSNumber<SDLFloat> *)height { @@ -57,7 +60,8 @@ } - (NSNumber<SDLFloat> *)height { - return [store sdl_objectForName:SDLRPCParameterNameHeight]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameHeight ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLRegisterAppInterface.m b/SmartDeviceLink/SDLRegisterAppInterface.m index 82bc3b92b..9299e44c4 100644 --- a/SmartDeviceLink/SDLRegisterAppInterface.m +++ b/SmartDeviceLink/SDLRegisterAppInterface.m @@ -129,7 +129,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)appName { - return [parameters sdl_objectForName:SDLRPCParameterNameAppName]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameAppName ofClass:NSString.class error:&error]; } - (void)setTtsName:(nullable NSArray<SDLTTSChunk *> *)ttsName { @@ -145,7 +146,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)ngnMediaScreenAppName { - return [parameters sdl_objectForName:SDLRPCParameterNameNGNMediaScreenAppName]; + return [parameters sdl_objectForName:SDLRPCParameterNameNGNMediaScreenAppName ofClass:NSString.class]; } - (void)setVrSynonyms:(nullable NSArray<NSString *> *)vrSynonyms { @@ -153,7 +154,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)vrSynonyms { - return [parameters sdl_objectForName:SDLRPCParameterNameVRSynonyms]; + return [parameters sdl_objectsForName:SDLRPCParameterNameVRSynonyms ofClass:NSString.class]; } - (void)setIsMediaApplication:(NSNumber<SDLBool> *)isMediaApplication { @@ -161,7 +162,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)isMediaApplication { - return [parameters sdl_objectForName:SDLRPCParameterNameIsMediaApplication]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameIsMediaApplication ofClass:NSNumber.class error:&error]; } - (void)setLanguageDesired:(SDLLanguage)languageDesired { @@ -169,7 +171,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLLanguage)languageDesired { - return [parameters sdl_objectForName:SDLRPCParameterNameLanguageDesired]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameLanguageDesired error:&error]; } - (void)setHmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired { @@ -177,7 +180,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLLanguage)hmiDisplayLanguageDesired { - return [parameters sdl_objectForName:SDLRPCParameterNameHMIDisplayLanguageDesired]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameHMIDisplayLanguageDesired error:&error]; } - (void)setAppHMIType:(nullable NSArray<SDLAppHMIType> *)appHMIType { @@ -185,7 +189,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLAppHMIType> *)appHMIType { - return [parameters sdl_objectForName:SDLRPCParameterNameAppHMIType]; + return [parameters sdl_enumsForName:SDLRPCParameterNameAppHMIType error:nil]; } - (void)setHashID:(nullable NSString *)hashID { @@ -193,7 +197,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)hashID { - return [parameters sdl_objectForName:SDLRPCParameterNameHashId]; + return [parameters sdl_objectForName:SDLRPCParameterNameHashId ofClass:NSString.class]; } - (void)setDeviceInfo:(nullable SDLDeviceInfo *)deviceInfo { @@ -209,7 +213,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)appID { - return [parameters sdl_objectForName:SDLRPCParameterNameAppId]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameAppId ofClass:NSString.class error:&error]; } - (void)setFullAppID:(nullable NSString *)fullAppID { @@ -217,7 +222,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)fullAppID { - return [parameters sdl_objectForName:SDLRPCParameterNameFullAppID]; + return [parameters sdl_objectForName:SDLRPCParameterNameFullAppID ofClass:NSString.class]; } - (void)setAppInfo:(nullable SDLAppInfo *)appInfo { diff --git a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m index a036814f6..56adb870b 100644 --- a/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m +++ b/SmartDeviceLink/SDLRegisterAppInterfaceResponse.m @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLLanguage)language { - return [parameters sdl_objectForName:SDLRPCParameterNameLanguage]; + return [parameters sdl_enumForName:SDLRPCParameterNameLanguage error:nil]; } - (void)setHmiDisplayLanguage:(nullable SDLLanguage)hmiDisplayLanguage { @@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLLanguage)hmiDisplayLanguage { - return [parameters sdl_objectForName:SDLRPCParameterNameHMIDisplayLanguage]; + return [parameters sdl_enumForName:SDLRPCParameterNameHMIDisplayLanguage error:nil]; } - (void)setDisplayCapabilities:(nullable SDLDisplayCapabilities *)displayCapabilities { @@ -88,7 +88,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLHMIZoneCapabilities> *)hmiZoneCapabilities { - return [parameters sdl_objectForName:SDLRPCParameterNameHMIZoneCapabilities]; + return [parameters sdl_enumsForName:SDLRPCParameterNameHMIZoneCapabilities error:nil]; } - (void)setSpeechCapabilities:(nullable NSArray<SDLSpeechCapabilities> *)speechCapabilities { @@ -96,7 +96,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLSpeechCapabilities> *)speechCapabilities { - return [parameters sdl_objectForName:SDLRPCParameterNameSpeechCapabilities]; + return [parameters sdl_enumsForName:SDLRPCParameterNameSpeechCapabilities error:nil]; } - (void)setPrerecordedSpeech:(nullable NSArray<SDLPrerecordedSpeech> *)prerecordedSpeech { @@ -104,7 +104,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLPrerecordedSpeech> *)prerecordedSpeech { - return [parameters sdl_objectForName:SDLRPCParameterNamePrerecordedSpeech]; + return [parameters sdl_enumsForName:SDLRPCParameterNamePrerecordedSpeech error:nil]; } - (void)setVrCapabilities:(nullable NSArray<SDLVRCapabilities> *)vrCapabilities { @@ -112,7 +112,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLVRCapabilities> *)vrCapabilities { - return [parameters sdl_objectForName:SDLRPCParameterNameVRCapabilities]; + return [parameters sdl_enumsForName:SDLRPCParameterNameVRCapabilities error:nil]; } - (void)setAudioPassThruCapabilities:(nullable NSArray<SDLAudioPassThruCapabilities *> *)audioPassThruCapabilities { @@ -144,7 +144,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSNumber<SDLInt> *> *)supportedDiagModes { - return [parameters sdl_objectForName:SDLRPCParameterNameSupportedDiagnosticModes]; + return [parameters sdl_objectsForName:SDLRPCParameterNameSupportedDiagnosticModes ofClass:NSNumber.class]; } - (void)setHmiCapabilities:(nullable SDLHMICapabilities *)hmiCapabilities { @@ -160,7 +160,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)sdlVersion { - return [parameters sdl_objectForName:SDLRPCParameterNameSDLVersion]; + return [parameters sdl_objectForName:SDLRPCParameterNameSDLVersion ofClass:NSString.class]; } - (void)setSystemSoftwareVersion:(nullable NSString *)systemSoftwareVersion { @@ -168,7 +168,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)systemSoftwareVersion { - return [parameters sdl_objectForName:SDLRPCParameterNameSystemSoftwareVersion]; + return [parameters sdl_objectForName:SDLRPCParameterNameSystemSoftwareVersion ofClass:NSString.class]; } - (void)setIconResumed:(nullable NSNumber<SDLBool> *)iconResumed { @@ -176,7 +176,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)iconResumed { - return [parameters sdl_objectForName:SDLRPCParameterNameIconResumed]; + return [parameters sdl_objectForName:SDLRPCParameterNameIconResumed ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLResetGlobalProperties.m b/SmartDeviceLink/SDLResetGlobalProperties.m index b0491ccbb..cdc258432 100644 --- a/SmartDeviceLink/SDLResetGlobalProperties.m +++ b/SmartDeviceLink/SDLResetGlobalProperties.m @@ -35,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLGlobalProperty> *)properties { - return [parameters sdl_objectForName:SDLRPCParameterNameProperties]; + NSError *error; + return [parameters sdl_enumsForName:SDLRPCParameterNameProperties error:&error]; } @end diff --git a/SmartDeviceLink/SDLSISData.m b/SmartDeviceLink/SDLSISData.m index 276147c03..b2f40425b 100644 --- a/SmartDeviceLink/SDLSISData.m +++ b/SmartDeviceLink/SDLSISData.m @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)stationShortName { - return [store sdl_objectForName:SDLRPCParameterNameStationShortName]; + return [store sdl_objectForName:SDLRPCParameterNameStationShortName ofClass:NSString.class]; } - (void)setStationIDNumber:(nullable SDLStationIDNumber *)stationIDNumber { @@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)stationLongName { - return [store sdl_objectForName:SDLRPCParameterNameStationLongName]; + return [store sdl_objectForName:SDLRPCParameterNameStationLongName ofClass:NSString.class];; } - (void)setStationLocation:(nullable SDLGPSData *)stationLocation { @@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)stationMessage { - return [store sdl_objectForName:SDLRPCParameterNameStationMessage]; + return [store sdl_objectForName:SDLRPCParameterNameStationMessage ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLScreenParams.m b/SmartDeviceLink/SDLScreenParams.m index 449bd7150..95d255f81 100644 --- a/SmartDeviceLink/SDLScreenParams.m +++ b/SmartDeviceLink/SDLScreenParams.m @@ -17,7 +17,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLImageResolution *)resolution { - return [store sdl_objectForName:SDLRPCParameterNameResolution ofClass:SDLImageResolution.class]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameResolution ofClass:SDLImageResolution.class error:&error]; } - (void)setTouchEventAvailable:(nullable SDLTouchEventCapabilities *)touchEventAvailable { diff --git a/SmartDeviceLink/SDLScrollableMessage.m b/SmartDeviceLink/SDLScrollableMessage.m index 250ffa739..92f1e68ea 100644 --- a/SmartDeviceLink/SDLScrollableMessage.m +++ b/SmartDeviceLink/SDLScrollableMessage.m @@ -47,7 +47,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)scrollableMessageBody { - return [parameters sdl_objectForName:SDLRPCParameterNameScrollableMessageBody]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameScrollableMessageBody ofClass:NSString.class error:&error]; } - (void)setTimeout:(nullable NSNumber<SDLInt> *)timeout { @@ -55,7 +56,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)timeout { - return [parameters sdl_objectForName:SDLRPCParameterNameTimeout]; + return [parameters sdl_objectForName:SDLRPCParameterNameTimeout ofClass:NSNumber.class]; } - (void)setSoftButtons:(nullable NSArray<SDLSoftButton *> *)softButtons { diff --git a/SmartDeviceLink/SDLSeatControlCapabilities.m b/SmartDeviceLink/SDLSeatControlCapabilities.m index e0fb23c5d..b9955b03c 100644 --- a/SmartDeviceLink/SDLSeatControlCapabilities.m +++ b/SmartDeviceLink/SDLSeatControlCapabilities.m @@ -48,7 +48,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)moduleName { - return [store sdl_objectForName:SDLRPCParameterNameModuleName]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameModuleName ofClass:NSString.class error:&error]; } - (void)setHeatingEnabledAvailable:(nullable NSNumber<SDLBool> *)heatingEnabledAvailable { @@ -56,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatingEnabledAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHeatingEnabledAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHeatingEnabledAvailable ofClass:NSNumber.class]; } - (void)setCoolingEnabledAvailable:(nullable NSNumber<SDLBool> *)coolingEnabledAvailable { @@ -65,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)coolingEnabledAvailable { - return [store sdl_objectForName:SDLRPCParameterNameCoolingEnabledAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameCoolingEnabledAvailable ofClass:NSNumber.class]; } @@ -75,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatingLevelAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHeatingLevelAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHeatingLevelAvailable ofClass:NSNumber.class]; } @@ -85,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)coolingLevelAvailable { - return [store sdl_objectForName:SDLRPCParameterNameCoolingLevelAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameCoolingLevelAvailable ofClass:NSNumber.class]; } @@ -95,7 +96,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)horizontalPositionAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHorizontalPositionAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHorizontalPositionAvailable ofClass:NSNumber.class]; } @@ -105,7 +106,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)verticalPositionAvailable { - return [store sdl_objectForName:SDLRPCParameterNameVerticalPositionAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameVerticalPositionAvailable ofClass:NSNumber.class]; } @@ -115,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)frontVerticalPositionAvailable { - return [store sdl_objectForName:SDLRPCParameterNameFrontVerticalPositionAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameFrontVerticalPositionAvailable ofClass:NSNumber.class]; } @@ -125,7 +126,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)backVerticalPositionAvailable { - return [store sdl_objectForName:SDLRPCParameterNameBackVerticalPositionAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameBackVerticalPositionAvailable ofClass:NSNumber.class]; } @@ -135,7 +136,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)backTiltAngleAvailable { - return [store sdl_objectForName:SDLRPCParameterNameBackTiltAngleAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameBackTiltAngleAvailable ofClass:NSNumber.class]; } @@ -145,7 +146,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)headSupportHorizontalPositionAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHeadSupportHorizontalPositionAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHeadSupportHorizontalPositionAvailable ofClass:NSNumber.class]; } @@ -155,7 +156,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)headSupportVerticalPositionAvailable { - return [store sdl_objectForName:SDLRPCParameterNameHeadSupportVerticalPositionAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameHeadSupportVerticalPositionAvailable ofClass:NSNumber.class]; } @@ -165,7 +166,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)massageEnabledAvailable { - return [store sdl_objectForName:SDLRPCParameterNameMassageEnabledAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameMassageEnabledAvailable ofClass:NSNumber.class]; } @@ -175,7 +176,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)massageModeAvailable { - return [store sdl_objectForName:SDLRPCParameterNameMassageModeAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameMassageModeAvailable ofClass:NSNumber.class]; } @@ -185,7 +186,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)massageCushionFirmnessAvailable { - return [store sdl_objectForName:SDLRPCParameterNameMassageCushionFirmnessAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameMassageCushionFirmnessAvailable ofClass:NSNumber.class]; } @@ -195,7 +196,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)memoryAvailable { - return [store sdl_objectForName:SDLRPCParameterNameMemoryAvailable]; + return [store sdl_objectForName:SDLRPCParameterNameMemoryAvailable ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLSeatControlData.m b/SmartDeviceLink/SDLSeatControlData.m index 1dac193e7..d9c47a0e6 100644 --- a/SmartDeviceLink/SDLSeatControlData.m +++ b/SmartDeviceLink/SDLSeatControlData.m @@ -58,7 +58,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSupportedSeat)id { - return [store sdl_objectForName:SDLRPCParameterNameId]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameId error:&error]; } - (void)setHeatingEnabled:(nullable NSNumber<SDLBool> *)heatingEnabled { @@ -66,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)heatingEnabled { - return [store sdl_objectForName:SDLRPCParameterNameHeatingEnabled]; + return [store sdl_objectForName:SDLRPCParameterNameHeatingEnabled ofClass:NSNumber.class]; } - (void)setCoolingEnabled:(nullable NSNumber<SDLBool> *)coolingEnabled { @@ -74,7 +75,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)coolingEnabled { - return [store sdl_objectForName:SDLRPCParameterNameCoolingEnabled]; + return [store sdl_objectForName:SDLRPCParameterNameCoolingEnabled ofClass:NSNumber.class]; } - (void)setHeatingLevel:(nullable NSNumber<SDLInt> *)heatingLevel { @@ -82,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)heatingLevel { - return [store sdl_objectForName:SDLRPCParameterNameHeatingLevel]; + return [store sdl_objectForName:SDLRPCParameterNameHeatingLevel ofClass:NSNumber.class]; } - (void)setCoolingLevel:(nullable NSNumber<SDLInt> *)coolingLevel { @@ -90,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)coolingLevel { - return [store sdl_objectForName:SDLRPCParameterNameCoolingLevel]; + return [store sdl_objectForName:SDLRPCParameterNameCoolingLevel ofClass:NSNumber.class]; } - (void)setHorizontalPosition:(nullable NSNumber<SDLInt> *)horizontalPosition { @@ -98,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)horizontalPosition { - return [store sdl_objectForName:SDLRPCParameterNameHorizontalPosition]; + return [store sdl_objectForName:SDLRPCParameterNameHorizontalPosition ofClass:NSNumber.class]; } - (void)setVerticalPosition:(nullable NSNumber<SDLInt> *)verticalPosition { @@ -106,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)verticalPosition { - return [store sdl_objectForName:SDLRPCParameterNameVerticalPosition]; + return [store sdl_objectForName:SDLRPCParameterNameVerticalPosition ofClass:NSNumber.class]; } - (void)setFrontVerticalPosition:(nullable NSNumber<SDLInt> *)frontVerticalPosition { @@ -114,7 +115,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)frontVerticalPosition { - return [store sdl_objectForName:SDLRPCParameterNameFrontVerticalPosition]; + return [store sdl_objectForName:SDLRPCParameterNameFrontVerticalPosition ofClass:NSNumber.class]; } - (void)setBackVerticalPosition:(nullable NSNumber<SDLInt> *)backVerticalPosition { @@ -122,7 +123,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)backVerticalPosition { - return [store sdl_objectForName:SDLRPCParameterNameBackVerticalPosition]; + return [store sdl_objectForName:SDLRPCParameterNameBackVerticalPosition ofClass:NSNumber.class]; } - (void)setBackTiltAngle:(nullable NSNumber<SDLInt> *)backTiltAngle { @@ -130,7 +131,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)backTiltAngle { - return [store sdl_objectForName:SDLRPCParameterNameBackTiltAngle]; + return [store sdl_objectForName:SDLRPCParameterNameBackTiltAngle ofClass:NSNumber.class]; } - (void)setHeadSupportHorizontalPosition:(nullable NSNumber<SDLInt> *)headSupportHorizontalPosition { @@ -138,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)headSupportHorizontalPosition { - return [store sdl_objectForName:SDLRPCParameterNameHeadSupportHorizontalPosition]; + return [store sdl_objectForName:SDLRPCParameterNameHeadSupportHorizontalPosition ofClass:NSNumber.class]; } -(void)setHeadSupportVerticalPosition:(nullable NSNumber<SDLInt> *)headSupportVerticalPosition { @@ -146,7 +147,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)headSupportVerticalPosition { - return [store sdl_objectForName:SDLRPCParameterNameHeadSupportVerticalPosition]; + return [store sdl_objectForName:SDLRPCParameterNameHeadSupportVerticalPosition ofClass:NSNumber.class]; } - (void)setMassageEnabled:(nullable NSNumber<SDLBool> *)massageEnabled { @@ -154,7 +155,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)massageEnabled { - return [store sdl_objectForName:SDLRPCParameterNameMassageEnabled]; + return [store sdl_objectForName:SDLRPCParameterNameMassageEnabled ofClass:NSNumber.class]; } @@ -163,7 +164,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLMassageModeData *> *)massageMode { - return [store sdl_objectForName:SDLRPCParameterNameMassageMode ]; + return [store sdl_objectsForName:SDLRPCParameterNameMassageMode ofClass:SDLMassageModeData.class]; } - (void)setMassageCushionFirmness:(nullable NSArray<SDLMassageCushionFirmness *> *)massageCushionFirmness { @@ -171,7 +172,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLMassageCushionFirmness *> *)massageCushionFirmness { - return [store sdl_objectForName:SDLRPCParameterNameMassageCushionFirmness]; + return [store sdl_objectsForName:SDLRPCParameterNameMassageCushionFirmness ofClass:SDLMassageCushionFirmness.class]; } - (void)setMemory:(nullable SDLSeatMemoryAction *)memory { diff --git a/SmartDeviceLink/SDLSeatMemoryAction.m b/SmartDeviceLink/SDLSeatMemoryAction.m index 3f0ed8a1d..5e69f94dc 100644 --- a/SmartDeviceLink/SDLSeatMemoryAction.m +++ b/SmartDeviceLink/SDLSeatMemoryAction.m @@ -36,7 +36,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)id { - return [store sdl_objectForName:SDLRPCParameterNameId]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameId ofClass:NSNumber.class error:&error]; } - (void)setLabel:(nullable NSString *)label { @@ -44,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)label { - return [store sdl_objectForName:SDLRPCParameterNameLabel]; + return [store sdl_objectForName:SDLRPCParameterNameLabel ofClass:NSString.class]; } - (void)setAction:(SDLSeatMemoryActionType)action { @@ -52,7 +53,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSeatMemoryActionType)action { - return [store sdl_objectForName:SDLRPCParameterNameAction]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameAction error:&error]; } @end diff --git a/SmartDeviceLink/SDLSendLocation.m b/SmartDeviceLink/SDLSendLocation.m index f35c4aed8..2460c632a 100644 --- a/SmartDeviceLink/SDLSendLocation.m +++ b/SmartDeviceLink/SDLSendLocation.m @@ -66,7 +66,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)longitudeDegrees { - return [parameters sdl_objectForName:SDLRPCParameterNameLongitudeDegrees]; + return [parameters sdl_objectForName:SDLRPCParameterNameLongitudeDegrees ofClass:NSNumber.class]; } - (void)setLatitudeDegrees:(nullable NSNumber<SDLFloat> *)latitudeDegrees { @@ -74,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)latitudeDegrees { - return [parameters sdl_objectForName:SDLRPCParameterNameLatitudeDegrees]; + return [parameters sdl_objectForName:SDLRPCParameterNameLatitudeDegrees ofClass:NSNumber.class]; } - (void)setLocationName:(nullable NSString *)locationName { @@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)locationName { - return [parameters sdl_objectForName:SDLRPCParameterNameLocationName]; + return [parameters sdl_objectForName:SDLRPCParameterNameLocationName ofClass:NSString.class]; } - (void)setAddressLines:(nullable NSArray<NSString *> *)addressLines { @@ -90,7 +90,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)locationDescription { - return [parameters sdl_objectForName:SDLRPCParameterNameLocationDescription]; + return [parameters sdl_objectForName:SDLRPCParameterNameLocationDescription ofClass:NSString.class]; } - (void)setLocationDescription:(nullable NSString *)locationDescription { @@ -98,7 +98,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)addressLines { - return [parameters sdl_objectForName:SDLRPCParameterNameAddressLines]; + return [parameters sdl_objectsForName:SDLRPCParameterNameAddressLines ofClass:NSString.class]; } - (void)setPhoneNumber:(nullable NSString *)phoneNumber { @@ -106,7 +106,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)phoneNumber { - return [parameters sdl_objectForName:SDLRPCParameterNamePhoneNumber]; + return [parameters sdl_objectForName:SDLRPCParameterNamePhoneNumber ofClass:NSString.class]; } - (void)setLocationImage:(nullable SDLImage *)locationImage { @@ -122,7 +122,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLDeliveryMode)deliveryMode { - return [parameters sdl_objectForName:SDLRPCParameterNameDeliveryMode]; + return [parameters sdl_enumForName:SDLRPCParameterNameDeliveryMode error:nil]; } - (void)setTimeStamp:(nullable SDLDateTime *)timeStamp { diff --git a/SmartDeviceLink/SDLSetAppIcon.m b/SmartDeviceLink/SDLSetAppIcon.m index a360f8237..e3a5d9756 100644 --- a/SmartDeviceLink/SDLSetAppIcon.m +++ b/SmartDeviceLink/SDLSetAppIcon.m @@ -32,7 +32,8 @@ } - (NSString *)syncFileName { - return [parameters sdl_objectForName:SDLRPCParameterNameSyncFileName]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameSyncFileName ofClass:NSString.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLSetDisplayLayout.m b/SmartDeviceLink/SDLSetDisplayLayout.m index fc0d6149f..b99994681 100644 --- a/SmartDeviceLink/SDLSetDisplayLayout.m +++ b/SmartDeviceLink/SDLSetDisplayLayout.m @@ -49,7 +49,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)displayLayout { - return [parameters sdl_objectForName:SDLRPCParameterNameDisplayLayout]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameDisplayLayout ofClass:NSString.class error:&error]; } - (void)setDayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme { diff --git a/SmartDeviceLink/SDLSetGlobalProperties.m b/SmartDeviceLink/SDLSetGlobalProperties.m index 89dbfaaee..b5c279a3d 100644 --- a/SmartDeviceLink/SDLSetGlobalProperties.m +++ b/SmartDeviceLink/SDLSetGlobalProperties.m @@ -68,7 +68,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)vrHelpTitle { - return [parameters sdl_objectForName:SDLRPCParameterNameVRHelpTitle]; + return [parameters sdl_objectForName:SDLRPCParameterNameVRHelpTitle ofClass:NSString.class]; } - (void)setVrHelp:(nullable NSArray<SDLVRHelpItem *> *)vrHelp { @@ -84,7 +84,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)menuTitle { - return [parameters sdl_objectForName:SDLRPCParameterNameMenuTitle]; + return [parameters sdl_objectForName:SDLRPCParameterNameMenuTitle ofClass:NSString.class]; } - (void)setMenuIcon:(nullable SDLImage *)menuIcon { diff --git a/SmartDeviceLink/SDLSetInteriorVehicleData.m b/SmartDeviceLink/SDLSetInteriorVehicleData.m index bbb875c83..7f99cc534 100644 --- a/SmartDeviceLink/SDLSetInteriorVehicleData.m +++ b/SmartDeviceLink/SDLSetInteriorVehicleData.m @@ -33,8 +33,9 @@ NS_ASSUME_NONNULL_BEGIN [parameters sdl_setObject:moduleData forName:SDLRPCParameterNameModuleData]; } -- (SDLModuleData *)moduleData { - return [parameters sdl_objectForName:SDLRPCParameterNameModuleData ofClass:SDLModuleData.class]; +- (SDLModuleData *)moduleData { + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameModuleData ofClass:SDLModuleData.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLSetInteriorVehicleDataResponse.m b/SmartDeviceLink/SDLSetInteriorVehicleDataResponse.m index dd9b1b4dd..4aeb90eda 100644 --- a/SmartDeviceLink/SDLSetInteriorVehicleDataResponse.m +++ b/SmartDeviceLink/SDLSetInteriorVehicleDataResponse.m @@ -23,7 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLModuleData *)moduleData { - return [parameters sdl_objectForName:SDLRPCParameterNameModuleData ofClass:SDLModuleData.class]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameModuleData ofClass:SDLModuleData.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLSetMediaClockTimer.m b/SmartDeviceLink/SDLSetMediaClockTimer.m index 2929a2ab5..d86a163b7 100644 --- a/SmartDeviceLink/SDLSetMediaClockTimer.m +++ b/SmartDeviceLink/SDLSetMediaClockTimer.m @@ -130,7 +130,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLUpdateMode)updateMode { - return [parameters sdl_objectForName:SDLRPCParameterNameUpdateMode]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameUpdateMode error:&error]; } - (void)setAudioStreamingIndicator:(nullable SDLAudioStreamingIndicator)audioStreamingIndicator { @@ -138,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLAudioStreamingIndicator)audioStreamingIndicator { - return [parameters sdl_objectForName:SDLRPCParameterNameAudioStreamingIndicator]; + return [parameters sdl_enumForName:SDLRPCParameterNameAudioStreamingIndicator error:nil]; } @end diff --git a/SmartDeviceLink/SDLShow.m b/SmartDeviceLink/SDLShow.m index 3556c830f..efeba27a0 100644 --- a/SmartDeviceLink/SDLShow.m +++ b/SmartDeviceLink/SDLShow.m @@ -102,7 +102,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)mainField1 { - return [parameters sdl_objectForName:SDLRPCParameterNameMainField1]; + return [parameters sdl_objectForName:SDLRPCParameterNameMainField1 ofClass:NSString.class]; } - (void)setMainField2:(nullable NSString *)mainField2 { @@ -110,7 +110,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)mainField2 { - return [parameters sdl_objectForName:SDLRPCParameterNameMainField2]; + return [parameters sdl_objectForName:SDLRPCParameterNameMainField2 ofClass:NSString.class]; } - (void)setMainField3:(nullable NSString *)mainField3 { @@ -118,7 +118,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)mainField3 { - return [parameters sdl_objectForName:SDLRPCParameterNameMainField3]; + return [parameters sdl_objectForName:SDLRPCParameterNameMainField3 ofClass:NSString.class]; } - (void)setMainField4:(nullable NSString *)mainField4 { @@ -126,7 +126,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)mainField4 { - return [parameters sdl_objectForName:SDLRPCParameterNameMainField4]; + return [parameters sdl_objectForName:SDLRPCParameterNameMainField4 ofClass:NSString.class]; } - (void)setAlignment:(nullable SDLTextAlignment)alignment { @@ -134,7 +134,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLTextAlignment)alignment { - return [parameters sdl_objectForName:SDLRPCParameterNameAlignment]; + return [parameters sdl_enumForName:SDLRPCParameterNameAlignment error:nil]; } - (void)setStatusBar:(nullable NSString *)statusBar { @@ -142,7 +142,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)statusBar { - return [parameters sdl_objectForName:SDLRPCParameterNameStatusBar]; + return [parameters sdl_objectForName:SDLRPCParameterNameStatusBar ofClass:NSString.class]; } - (void)setMediaClock:(nullable NSString *)mediaClock { @@ -150,7 +150,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)mediaClock { - return [parameters sdl_objectForName:SDLRPCParameterNameMediaClock]; + return [parameters sdl_objectForName:SDLRPCParameterNameMediaClock ofClass:NSString.class]; } - (void)setMediaTrack:(nullable NSString *)mediaTrack { @@ -158,7 +158,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)mediaTrack { - return [parameters sdl_objectForName:SDLRPCParameterNameMediaTrack]; + return [parameters sdl_objectForName:SDLRPCParameterNameMediaTrack ofClass:NSString.class]; } - (void)setGraphic:(nullable SDLImage *)graphic { @@ -190,7 +190,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)customPresets { - return [parameters sdl_objectForName:SDLRPCParameterNameCustomPresets]; + return [parameters sdl_objectsForName:SDLRPCParameterNameCustomPresets ofClass:NSString.class]; } - (void)setMetadataTags:(nullable SDLMetadataTags *)metadataTags { diff --git a/SmartDeviceLink/SDLShowConstantTBT.m b/SmartDeviceLink/SDLShowConstantTBT.m index d61ae78bf..ceb2b37c2 100644 --- a/SmartDeviceLink/SDLShowConstantTBT.m +++ b/SmartDeviceLink/SDLShowConstantTBT.m @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)navigationText1 { - return [parameters sdl_objectForName:SDLRPCParameterNameNavigationText1]; + return [parameters sdl_objectForName:SDLRPCParameterNameNavigationText1 ofClass:NSString.class]; } - (void)setNavigationText2:(nullable NSString *)navigationText2 { @@ -54,7 +54,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)navigationText2 { - return [parameters sdl_objectForName:SDLRPCParameterNameNavigationText2]; + return [parameters sdl_objectForName:SDLRPCParameterNameNavigationText2 ofClass:NSString.class]; } - (void)setEta:(nullable NSString *)eta { @@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)eta { - return [parameters sdl_objectForName:SDLRPCParameterNameETA]; + return [parameters sdl_objectForName:SDLRPCParameterNameETA ofClass:NSString.class]; } - (void)setTimeToDestination:(nullable NSString *)timeToDestination { @@ -70,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)timeToDestination { - return [parameters sdl_objectForName:SDLRPCParameterNameTimeToDestination]; + return [parameters sdl_objectForName:SDLRPCParameterNameTimeToDestination ofClass:NSString.class]; } - (void)setTotalDistance:(nullable NSString *)totalDistance { @@ -78,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)totalDistance { - return [parameters sdl_objectForName:SDLRPCParameterNameTotalDistance]; + return [parameters sdl_objectForName:SDLRPCParameterNameTotalDistance ofClass:NSString.class]; } - (void)setTurnIcon:(nullable SDLImage *)turnIcon { @@ -102,7 +102,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)distanceToManeuver { - return [parameters sdl_objectForName:SDLRPCParameterNameDistanceToManeuver]; + return [parameters sdl_objectForName:SDLRPCParameterNameDistanceToManeuver ofClass:NSNumber.class]; } - (void)setDistanceToManeuverScale:(nullable NSNumber<SDLFloat> *)distanceToManeuverScale { @@ -110,7 +110,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)distanceToManeuverScale { - return [parameters sdl_objectForName:SDLRPCParameterNameDistanceToManeuverScale]; + return [parameters sdl_objectForName:SDLRPCParameterNameDistanceToManeuverScale ofClass:NSNumber.class]; } - (void)setManeuverComplete:(nullable NSNumber<SDLBool> *)maneuverComplete { @@ -118,7 +118,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)maneuverComplete { - return [parameters sdl_objectForName:SDLRPCParameterNameManeuverComplete]; + return [parameters sdl_objectForName:SDLRPCParameterNameManeuverComplete ofClass:NSNumber.class]; } - (void)setSoftButtons:(nullable NSArray<SDLSoftButton *> *)softButtons { diff --git a/SmartDeviceLink/SDLSingleTireStatus.m b/SmartDeviceLink/SDLSingleTireStatus.m index 8ebc51810..45df91fc5 100644 --- a/SmartDeviceLink/SDLSingleTireStatus.m +++ b/SmartDeviceLink/SDLSingleTireStatus.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLComponentVolumeStatus)status { - return [store sdl_objectForName:SDLRPCParameterNameStatus]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameStatus error:&error]; } - (void)setMonitoringSystemStatus:(nullable SDLTPMS)monitoringSystemStatus { @@ -24,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLTPMS)monitoringSystemStatus { - return [store sdl_objectForName:SDLRPCParameterNameTPMS]; + return [store sdl_enumForName:SDLRPCParameterNameTPMS error:nil]; } - (void)setPressure:(nullable NSNumber<SDLFloat> *)pressure { @@ -32,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)pressure { - return [store sdl_objectForName:SDLRPCParameterNamePressure]; + return [store sdl_objectForName:SDLRPCParameterNamePressure ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLSlider.m b/SmartDeviceLink/SDLSlider.m index cd1b95d29..68a320ada 100644 --- a/SmartDeviceLink/SDLSlider.m +++ b/SmartDeviceLink/SDLSlider.m @@ -57,7 +57,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)numTicks { - return [parameters sdl_objectForName:SDLRPCParameterNameNumberTicks]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameNumberTicks ofClass:NSNumber.class error:&error]; } - (void)setPosition:(NSNumber<SDLInt> *)position { @@ -65,7 +66,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)position { - return [parameters sdl_objectForName:SDLRPCParameterNamePosition]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNamePosition ofClass:NSNumber.class error:&error]; } - (void)setSliderHeader:(NSString *)sliderHeader { @@ -73,7 +75,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)sliderHeader { - return [parameters sdl_objectForName:SDLRPCParameterNameSliderHeader]; + NSError *error; + return [parameters sdl_objectForName:SDLRPCParameterNameSliderHeader ofClass:NSString.class error:&error]; } - (void)setSliderFooter:(nullable NSArray<NSString *> *)sliderFooter { @@ -81,7 +84,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)sliderFooter { - return [parameters sdl_objectForName:SDLRPCParameterNameSliderFooter]; + return [parameters sdl_objectsForName:SDLRPCParameterNameSliderFooter ofClass:NSString.class]; } - (void)setTimeout:(nullable NSNumber<SDLInt> *)timeout { @@ -89,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)timeout { - return [parameters sdl_objectForName:SDLRPCParameterNameTimeout]; + return [parameters sdl_objectForName:SDLRPCParameterNameTimeout ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLSliderResponse.m b/SmartDeviceLink/SDLSliderResponse.m index d924b0cb5..1f8c03c9f 100644 --- a/SmartDeviceLink/SDLSliderResponse.m +++ b/SmartDeviceLink/SDLSliderResponse.m @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)sliderPosition { - return [parameters sdl_objectForName:SDLRPCParameterNameSliderPosition]; + return [parameters sdl_objectForName:SDLRPCParameterNameSliderPosition ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLSoftButton.m b/SmartDeviceLink/SDLSoftButton.m index 82ed612ea..fc15a61d6 100644 --- a/SmartDeviceLink/SDLSoftButton.m +++ b/SmartDeviceLink/SDLSoftButton.m @@ -44,7 +44,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSoftButtonType)type { - return [store sdl_objectForName:SDLRPCParameterNameType]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameType error:&error]; } - (void)setText:(nullable NSString *)text { @@ -52,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)text { - return [store sdl_objectForName:SDLRPCParameterNameText]; + return [store sdl_objectForName:SDLRPCParameterNameText ofClass:NSString.class]; } - (void)setImage:(nullable SDLImage *)image { @@ -68,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)isHighlighted { - return [store sdl_objectForName:SDLRPCParameterNameIsHighlighted]; + return [store sdl_objectForName:SDLRPCParameterNameIsHighlighted ofClass:NSNumber.class]; } - (void)setSoftButtonID:(NSNumber<SDLInt> *)softButtonID { @@ -76,7 +77,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)softButtonID { - return [store sdl_objectForName:SDLRPCParameterNameSoftButtonId]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameSoftButtonId ofClass:NSNumber.class error:&error]; } - (void)setSystemAction:(nullable SDLSystemAction)systemAction { @@ -84,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLSystemAction)systemAction { - return [store sdl_objectForName:SDLRPCParameterNameSystemAction]; + return [store sdl_enumForName:SDLRPCParameterNameSystemAction error:nil]; } -(id)copyWithZone:(nullable NSZone *)zone { diff --git a/SmartDeviceLink/SDLSoftButtonCapabilities.m b/SmartDeviceLink/SDLSoftButtonCapabilities.m index 438fd5b81..a591f1dd0 100644 --- a/SmartDeviceLink/SDLSoftButtonCapabilities.m +++ b/SmartDeviceLink/SDLSoftButtonCapabilities.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)shortPressAvailable { - return [store sdl_objectForName:SDLRPCParameterNameShortPressAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameShortPressAvailable ofClass:NSNumber.class error:&error]; } - (void)setLongPressAvailable:(NSNumber<SDLBool> *)longPressAvailable { @@ -24,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)longPressAvailable { - return [store sdl_objectForName:SDLRPCParameterNameLongPressAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameLongPressAvailable ofClass:NSNumber.class error:&error]; } - (void)setUpDownAvailable:(NSNumber<SDLBool> *)upDownAvailable { @@ -32,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)upDownAvailable { - return [store sdl_objectForName:SDLRPCParameterNameUpDownAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameUpDownAvailable ofClass:NSNumber.class error:&error]; } - (void)setImageSupported:(NSNumber<SDLBool> *)imageSupported { @@ -40,7 +43,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)imageSupported { - return [store sdl_objectForName:SDLRPCParameterNameImageSupported]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameImageSupported ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLSpeak.m b/SmartDeviceLink/SDLSpeak.m index fb0a063a0..bfd65f902 100644 --- a/SmartDeviceLink/SDLSpeak.m +++ b/SmartDeviceLink/SDLSpeak.m @@ -40,7 +40,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLTTSChunk *> *)ttsChunks { - return [parameters sdl_objectsForName:SDLRPCParameterNameTTSChunks ofClass:SDLTTSChunk.class]; + NSError *error; + return [parameters sdl_objectsForName:SDLRPCParameterNameTTSChunks ofClass:SDLTTSChunk.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLStartTime.m b/SmartDeviceLink/SDLStartTime.m index 3394487ee..1bd5dd82d 100644 --- a/SmartDeviceLink/SDLStartTime.m +++ b/SmartDeviceLink/SDLStartTime.m @@ -42,7 +42,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)hours { - return [store sdl_objectForName:SDLRPCParameterNameHours]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameHours ofClass:NSNumber.class error:&error]; } - (void)setMinutes:(NSNumber<SDLInt> *)minutes { @@ -50,7 +51,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)minutes { - return [store sdl_objectForName:SDLRPCParameterNameMinutes]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameMinutes ofClass:NSNumber.class error:&error]; } - (void)setSeconds:(NSNumber<SDLInt> *)seconds { @@ -58,7 +60,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)seconds { - return [store sdl_objectForName:SDLRPCParameterNameSeconds]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameSeconds ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLStationIDNumber.m b/SmartDeviceLink/SDLStationIDNumber.m index b2d3f8a02..6c4922c74 100644 --- a/SmartDeviceLink/SDLStationIDNumber.m +++ b/SmartDeviceLink/SDLStationIDNumber.m @@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)countryCode { - return [store sdl_objectForName:SDLRPCParameterNameCountryCode]; + return [store sdl_objectForName:SDLRPCParameterNameCountryCode ofClass:NSNumber.class]; } @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)fccFacilityId { - return [store sdl_objectForName:SDLRPCParameterNameFCCFacilityId]; + return [store sdl_objectForName:SDLRPCParameterNameFCCFacilityId ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLSubscribeButton.m b/SmartDeviceLink/SDLSubscribeButton.m index da4bd5c54..dd314fa57 100644 --- a/SmartDeviceLink/SDLSubscribeButton.m +++ b/SmartDeviceLink/SDLSubscribeButton.m @@ -46,7 +46,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLButtonName)buttonName { - return [parameters sdl_objectForName:SDLRPCParameterNameButtonName]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameButtonName error:&error]; } -(id)copyWithZone:(nullable NSZone *)zone { diff --git a/SmartDeviceLink/SDLSubscribeVehicleData.m b/SmartDeviceLink/SDLSubscribeVehicleData.m index aed344cc3..24b46577d 100644 --- a/SmartDeviceLink/SDLSubscribeVehicleData.m +++ b/SmartDeviceLink/SDLSubscribeVehicleData.m @@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)gps { - return [parameters sdl_objectForName:SDLRPCParameterNameGPS]; + return [parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:NSNumber.class]; } - (void)setSpeed:(nullable NSNumber<SDLBool> *)speed { @@ -73,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)speed { - return [parameters sdl_objectForName:SDLRPCParameterNameSpeed]; + return [parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class]; } - (void)setRpm:(nullable NSNumber<SDLBool> *)rpm { @@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)rpm { - return [parameters sdl_objectForName:SDLRPCParameterNameRPM]; + return [parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class]; } - (void)setFuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel { @@ -89,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelLevel { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevel]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class]; } - (void)setFuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State { @@ -97,7 +97,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelLevel_State { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState ofClass:NSNumber.class]; } - (void)setFuelRange:(nullable NSNumber<SDLBool> *)fuelRange { @@ -105,7 +105,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelRange { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelRange]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelRange ofClass:NSNumber.class]; } - (void)setInstantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption { @@ -113,7 +113,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)instantFuelConsumption { - return [parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption]; + return [parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class]; } - (void)setExternalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature { @@ -121,7 +121,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)externalTemperature { - return [parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature]; + return [parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class]; } - (void)setPrndl:(nullable NSNumber<SDLBool> *)prndl { @@ -129,7 +129,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)prndl { - return [parameters sdl_objectForName:SDLRPCParameterNamePRNDL]; + return [parameters sdl_objectForName:SDLRPCParameterNamePRNDL ofClass:NSNumber.class]; } - (void)setTirePressure:(nullable NSNumber<SDLBool> *)tirePressure { @@ -137,7 +137,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)tirePressure { - return [parameters sdl_objectForName:SDLRPCParameterNameTirePressure]; + return [parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:NSNumber.class]; } - (void)setOdometer:(nullable NSNumber<SDLBool> *)odometer { @@ -145,7 +145,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)odometer { - return [parameters sdl_objectForName:SDLRPCParameterNameOdometer]; + return [parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class]; } - (void)setBeltStatus:(nullable NSNumber<SDLBool> *)beltStatus { @@ -153,7 +153,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)beltStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameBeltStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:NSNumber.class]; } - (void)setBodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation { @@ -161,7 +161,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)bodyInformation { - return [parameters sdl_objectForName:SDLRPCParameterNameBodyInformation]; + return [parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:NSNumber.class]; } - (void)setDeviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus { @@ -169,7 +169,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)deviceStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:NSNumber.class]; } - (void)setDriverBraking:(nullable NSNumber<SDLBool> *)driverBraking { @@ -177,7 +177,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)driverBraking { - return [parameters sdl_objectForName:SDLRPCParameterNameDriverBraking]; + return [parameters sdl_objectForName:SDLRPCParameterNameDriverBraking ofClass:NSNumber.class]; } - (void)setWiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus { @@ -185,7 +185,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)wiperStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameWiperStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameWiperStatus ofClass:NSNumber.class]; } - (void)setHeadLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus { @@ -193,7 +193,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)headLampStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:NSNumber.class]; } - (void)setEngineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife { @@ -201,7 +201,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)engineOilLife { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class]; } - (void)setEngineTorque:(nullable NSNumber<SDLBool> *)engineTorque { @@ -209,7 +209,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)engineTorque { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineTorque]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class]; } - (void)setAccPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition { @@ -217,7 +217,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)accPedalPosition { - return [parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition]; + return [parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class]; } - (void)setSteeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle { @@ -225,7 +225,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)steeringWheelAngle { - return [parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle]; + return [parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class]; } - (void)setECallInfo:(nullable NSNumber<SDLBool> *)eCallInfo { @@ -233,7 +233,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)eCallInfo { - return [parameters sdl_objectForName:SDLRPCParameterNameECallInfo]; + return [parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:NSNumber.class]; } - (void)setAirbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus { @@ -241,7 +241,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)airbagStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:NSNumber.class]; } - (void)setEmergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent { @@ -249,7 +249,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)emergencyEvent { - return [parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent]; + return [parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:NSNumber.class]; } - (void)setClusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus { @@ -257,7 +257,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)clusterModeStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus ofClass:NSNumber.class]; } - (void)setMyKey:(nullable NSNumber<SDLBool> *)myKey { @@ -265,7 +265,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)myKey { - return [parameters sdl_objectForName:SDLRPCParameterNameMyKey]; + return [parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:NSNumber.class]; } - (void)setElectronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus { @@ -273,7 +273,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)electronicParkBrakeStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus ofClass:NSNumber.class]; } - (void)setTurnSignal:(nullable NSNumber<SDLBool> *)turnSignal { @@ -281,7 +281,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)turnSignal { - return [parameters sdl_objectForName:SDLRPCParameterNameTurnSignal]; + return [parameters sdl_objectForName:SDLRPCParameterNameTurnSignal ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m b/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m index 3e69ef715..ab575d0c5 100644 --- a/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m +++ b/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m @@ -155,12 +155,12 @@ NS_ASSUME_NONNULL_BEGIN return [parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:SDLVehicleDataResult.class]; } -- (void)setEngineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife { +- (void)setEngineOilLife:(nullable SDLVehicleDataResult *)engineOilLife { [parameters sdl_setObject:engineOilLife forName:SDLRPCParameterNameEngineOilLife]; } -- (nullable NSNumber<SDLBool> *)engineOilLife { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife]; +- (nullable SDLVehicleDataResult *)engineOilLife { + return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:SDLVehicleDataResult.class]; } - (void)setEngineTorque:(nullable SDLVehicleDataResult *)engineTorque { diff --git a/SmartDeviceLink/SDLSyncMsgVersion.m b/SmartDeviceLink/SDLSyncMsgVersion.m index 8c3565037..cc01938e1 100644 --- a/SmartDeviceLink/SDLSyncMsgVersion.m +++ b/SmartDeviceLink/SDLSyncMsgVersion.m @@ -29,7 +29,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)majorVersion { - return [store sdl_objectForName:SDLRPCParameterNameMajorVersion]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameMajorVersion ofClass:NSNumber.class error:&error]; } - (void)setMinorVersion:(NSNumber<SDLInt> *)minorVersion { @@ -37,7 +38,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)minorVersion { - return [store sdl_objectForName:SDLRPCParameterNameMinorVersion]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameMinorVersion ofClass:NSNumber.class error:&error]; } - (void)setPatchVersion:(nullable NSNumber<SDLInt> *)patchVersion { @@ -45,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)patchVersion { - return [store sdl_objectForName:SDLRPCParameterNamePatchVersion]; + return [store sdl_objectForName:SDLRPCParameterNamePatchVersion ofClass:NSNumber.class]; } - (NSString *)description { diff --git a/SmartDeviceLink/SDLSystemCapability.m b/SmartDeviceLink/SDLSystemCapability.m index 36ff7eadd..23cc35c3d 100755 --- a/SmartDeviceLink/SDLSystemCapability.m +++ b/SmartDeviceLink/SDLSystemCapability.m @@ -86,7 +86,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSystemCapabilityType)systemCapabilityType { - return [store sdl_objectForName:SDLRPCParameterNameSystemCapabilityType]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameSystemCapabilityType error:&error]; } - (void)setAppServicesCapabilities:(nullable SDLAppServicesCapabilities *)appServicesCapabilities { diff --git a/SmartDeviceLink/SDLSystemRequest.m b/SmartDeviceLink/SDLSystemRequest.m index 200999a3f..81cc6d9c5 100644 --- a/SmartDeviceLink/SDLSystemRequest.m +++ b/SmartDeviceLink/SDLSystemRequest.m @@ -46,7 +46,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLRequestType)requestType { - return [parameters sdl_objectForName:SDLRPCParameterNameRequestType]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameRequestType error:&error]; } - (void)setRequestSubType:(nullable NSString *)requestSubType { @@ -54,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)requestSubType { - return [parameters sdl_objectForName:SDLRPCParameterNameRequestSubType]; + return [parameters sdl_objectForName:SDLRPCParameterNameRequestSubType ofClass:NSString.class]; } - (void)setFileName:(nullable NSString *)fileName { @@ -62,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)fileName { - return [parameters sdl_objectForName:SDLRPCParameterNameFilename]; + return [parameters sdl_objectForName:SDLRPCParameterNameFilename ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLTTSChunk.m b/SmartDeviceLink/SDLTTSChunk.m index 655013283..76256582b 100644 --- a/SmartDeviceLink/SDLTTSChunk.m +++ b/SmartDeviceLink/SDLTTSChunk.m @@ -59,7 +59,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)text { - return [store sdl_objectForName:SDLRPCParameterNameText]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameText ofClass:NSString.class error:&error]; } - (void)setType:(SDLSpeechCapabilities)type { @@ -67,7 +68,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSpeechCapabilities)type { - return [store sdl_objectForName:SDLRPCParameterNameType]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameType error:&error]; } @end diff --git a/SmartDeviceLink/SDLTemperature.m b/SmartDeviceLink/SDLTemperature.m index ab8cfa1e0..27f54d363 100644 --- a/SmartDeviceLink/SDLTemperature.m +++ b/SmartDeviceLink/SDLTemperature.m @@ -35,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLTemperatureUnit)unit { - return [store sdl_objectForName:SDLRPCParameterNameUnit]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameUnit error:&error]; } - (void)setValue:(NSNumber<SDLFloat> *)value { @@ -43,7 +44,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLFloat> *)value { - return [store sdl_objectForName:SDLRPCParameterNameValue]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameValue ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLTextField.m b/SmartDeviceLink/SDLTextField.m index d880f1795..af2d04d24 100644 --- a/SmartDeviceLink/SDLTextField.m +++ b/SmartDeviceLink/SDLTextField.m @@ -17,7 +17,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLTextFieldName)name { - return [store sdl_objectForName:SDLRPCParameterNameName]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameName error:&error]; } - (void)setCharacterSet:(SDLCharacterSet)characterSet { @@ -25,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLCharacterSet)characterSet { - return [store sdl_objectForName:SDLRPCParameterNameCharacterSet]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameCharacterSet error:&error]; } - (void)setWidth:(NSNumber<SDLInt> *)width { @@ -33,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)width { - return [store sdl_objectForName:SDLRPCParameterNameWidth]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameWidth ofClass:NSNumber.class error:&error]; } - (void)setRows:(NSNumber<SDLInt> *)rows { @@ -41,7 +44,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)rows { - return [store sdl_objectForName:SDLRPCParameterNameRows]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameRows ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLTireStatus.m b/SmartDeviceLink/SDLTireStatus.m index 10baa94af..5ddabb0f2 100644 --- a/SmartDeviceLink/SDLTireStatus.m +++ b/SmartDeviceLink/SDLTireStatus.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLWarningLightStatus)pressureTelltale { - return [store sdl_objectForName:SDLRPCParameterNamePressureTelltale]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNamePressureTelltale error:&error]; } - (void)setLeftFront:(SDLSingleTireStatus *)leftFront { @@ -24,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSingleTireStatus *)leftFront { - return [store sdl_objectForName:SDLRPCParameterNameLeftFront ofClass:SDLSingleTireStatus.class]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameLeftFront ofClass:SDLSingleTireStatus.class error:&error]; } - (void)setRightFront:(SDLSingleTireStatus *)rightFront { @@ -32,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSingleTireStatus *)rightFront { - return [store sdl_objectForName:SDLRPCParameterNameRightFront ofClass:SDLSingleTireStatus.class]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameRightFront ofClass:SDLSingleTireStatus.class error:&error]; } - (void)setLeftRear:(SDLSingleTireStatus *)leftRear { @@ -40,7 +43,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSingleTireStatus *)leftRear { - return [store sdl_objectForName:SDLRPCParameterNameLeftRear ofClass:SDLSingleTireStatus.class]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameLeftRear ofClass:SDLSingleTireStatus.class error:&error]; } - (void)setRightRear:(SDLSingleTireStatus *)rightRear { @@ -48,7 +52,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSingleTireStatus *)rightRear { - return [store sdl_objectForName:SDLRPCParameterNameRightRear ofClass:SDLSingleTireStatus.class]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameRightRear ofClass:SDLSingleTireStatus.class error:&error]; } - (void)setInnerLeftRear:(SDLSingleTireStatus *)innerLeftRear { @@ -56,7 +61,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSingleTireStatus *)innerLeftRear { - return [store sdl_objectForName:SDLRPCParameterNameInnerLeftRear ofClass:SDLSingleTireStatus.class]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameInnerLeftRear ofClass:SDLSingleTireStatus.class error:&error]; } - (void)setInnerRightRear:(SDLSingleTireStatus *)innerRightRear { @@ -64,7 +70,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLSingleTireStatus *)innerRightRear { - return [store sdl_objectForName:SDLRPCParameterNameInnerRightRear ofClass:SDLSingleTireStatus.class]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameInnerRightRear ofClass:SDLSingleTireStatus.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLTouchCoord.m b/SmartDeviceLink/SDLTouchCoord.m index e8dd2d520..4e40d38b3 100644 --- a/SmartDeviceLink/SDLTouchCoord.m +++ b/SmartDeviceLink/SDLTouchCoord.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLFloat> *)x { - return [store sdl_objectForName:SDLRPCParameterNameX]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameX ofClass:NSNumber.class error:&error]; } - (void)setY:(NSNumber<SDLFloat> *)y { @@ -24,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLFloat> *)y { - return [store sdl_objectForName:SDLRPCParameterNameY]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameY ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLTouchEvent.m b/SmartDeviceLink/SDLTouchEvent.m index c48b4b61e..92c2f3b98 100644 --- a/SmartDeviceLink/SDLTouchEvent.m +++ b/SmartDeviceLink/SDLTouchEvent.m @@ -17,7 +17,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)touchEventId { - return [store sdl_objectForName:SDLRPCParameterNameId]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameId ofClass:NSNumber.class error:&error]; } - (void)setTimeStamp:(NSArray<NSNumber<SDLInt> *> *)timeStamp { @@ -25,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<NSNumber<SDLInt> *> *)timeStamp { - return [store sdl_objectForName:SDLRPCParameterNameTS]; + NSError *error; + return [store sdl_objectsForName:SDLRPCParameterNameTS ofClass:NSNumber.class error:&error]; } - (void)setCoord:(NSArray<SDLTouchCoord *> *)coord { @@ -33,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSArray<SDLTouchCoord *> *)coord { - return [store sdl_objectsForName:SDLRPCParameterNameCoordinate ofClass:SDLTouchCoord.class]; + NSError *error; + return [store sdl_objectsForName:SDLRPCParameterNameCoordinate ofClass:SDLTouchCoord.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLTouchEventCapabilities.m b/SmartDeviceLink/SDLTouchEventCapabilities.m index 2370f9e48..c3192e8a5 100644 --- a/SmartDeviceLink/SDLTouchEventCapabilities.m +++ b/SmartDeviceLink/SDLTouchEventCapabilities.m @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)pressAvailable { - return [store sdl_objectForName:SDLRPCParameterNamePressAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNamePressAvailable ofClass:NSNumber.class error:&error]; } - (void)setMultiTouchAvailable:(NSNumber<SDLBool> *)multiTouchAvailable { @@ -24,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)multiTouchAvailable { - return [store sdl_objectForName:SDLRPCParameterNameMultiTouchAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameMultiTouchAvailable ofClass:NSNumber.class error:&error]; } - (void)setDoublePressAvailable:(NSNumber<SDLBool> *)doublePressAvailable { @@ -32,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLBool> *)doublePressAvailable { - return [store sdl_objectForName:SDLRPCParameterNameDoublePressAvailable]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameDoublePressAvailable ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLTurn.m b/SmartDeviceLink/SDLTurn.m index a5a166269..925d2380e 100644 --- a/SmartDeviceLink/SDLTurn.m +++ b/SmartDeviceLink/SDLTurn.m @@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)navigationText { - return [store sdl_objectForName:SDLRPCParameterNameNavigationText]; + return [store sdl_objectForName:SDLRPCParameterNameNavigationText ofClass:NSString.class]; } - (void)setTurnIcon:(nullable SDLImage *)turnIcon { diff --git a/SmartDeviceLink/SDLUnsubscribeButton.m b/SmartDeviceLink/SDLUnsubscribeButton.m index a20cd1eee..af2738d1f 100644 --- a/SmartDeviceLink/SDLUnsubscribeButton.m +++ b/SmartDeviceLink/SDLUnsubscribeButton.m @@ -35,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLButtonName)buttonName { - return [parameters sdl_objectForName:SDLRPCParameterNameButtonName]; + NSError *error; + return [parameters sdl_enumForName:SDLRPCParameterNameButtonName error:&error]; } @end diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleData.m b/SmartDeviceLink/SDLUnsubscribeVehicleData.m index e68161178..2e84228e9 100644 --- a/SmartDeviceLink/SDLUnsubscribeVehicleData.m +++ b/SmartDeviceLink/SDLUnsubscribeVehicleData.m @@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)gps { - return [parameters sdl_objectForName:SDLRPCParameterNameGPS]; + return [parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:NSNumber.class]; } - (void)setSpeed:(nullable NSNumber<SDLBool> *)speed { @@ -73,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)speed { - return [parameters sdl_objectForName:SDLRPCParameterNameSpeed]; + return [parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class]; } - (void)setRpm:(nullable NSNumber<SDLBool> *)rpm { @@ -81,7 +81,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)rpm { - return [parameters sdl_objectForName:SDLRPCParameterNameRPM]; + return [parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class]; } - (void)setFuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel { @@ -89,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelLevel { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevel]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class]; } - (void)setFuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State { @@ -97,7 +97,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelLevel_State { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState ofClass:NSNumber.class]; } - (void)setFuelRange:(nullable NSNumber<SDLBool> *)fuelRange { @@ -105,7 +105,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelRange { - return [parameters sdl_objectForName:SDLRPCParameterNameFuelRange]; + return [parameters sdl_objectForName:SDLRPCParameterNameFuelRange ofClass:NSNumber.class]; } - (void)setInstantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption { @@ -113,7 +113,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)instantFuelConsumption { - return [parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption]; + return [parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class]; } - (void)setExternalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature { @@ -121,7 +121,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)externalTemperature { - return [parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature]; + return [parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class]; } - (void)setPrndl:(nullable NSNumber<SDLBool> *)prndl { @@ -129,7 +129,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)prndl { - return [parameters sdl_objectForName:SDLRPCParameterNamePRNDL]; + return [parameters sdl_objectForName:SDLRPCParameterNamePRNDL ofClass:NSNumber.class]; } - (void)setTirePressure:(nullable NSNumber<SDLBool> *)tirePressure { @@ -137,7 +137,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)tirePressure { - return [parameters sdl_objectForName:SDLRPCParameterNameTirePressure]; + return [parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:NSNumber.class]; } - (void)setOdometer:(nullable NSNumber<SDLBool> *)odometer { @@ -145,7 +145,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)odometer { - return [parameters sdl_objectForName:SDLRPCParameterNameOdometer]; + return [parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class]; } - (void)setBeltStatus:(nullable NSNumber<SDLBool> *)beltStatus { @@ -153,7 +153,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)beltStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameBeltStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:NSNumber.class]; } - (void)setBodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation { @@ -161,7 +161,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)bodyInformation { - return [parameters sdl_objectForName:SDLRPCParameterNameBodyInformation]; + return [parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:NSNumber.class]; } - (void)setDeviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus { @@ -169,7 +169,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)deviceStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:NSNumber.class]; } - (void)setDriverBraking:(nullable NSNumber<SDLBool> *)driverBraking { @@ -177,7 +177,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)driverBraking { - return [parameters sdl_objectForName:SDLRPCParameterNameDriverBraking]; + return [parameters sdl_objectForName:SDLRPCParameterNameDriverBraking ofClass:NSNumber.class]; } - (void)setWiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus { @@ -185,7 +185,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)wiperStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameWiperStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameWiperStatus ofClass:NSNumber.class]; } - (void)setHeadLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus { @@ -193,7 +193,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)headLampStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:NSNumber.class]; } - (void)setEngineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife { @@ -201,7 +201,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)engineOilLife { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class]; } - (void)setEngineTorque:(nullable NSNumber<SDLBool> *)engineTorque { @@ -209,7 +209,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)engineTorque { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineTorque]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class]; } - (void)setAccPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition { @@ -217,7 +217,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)accPedalPosition { - return [parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition]; + return [parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class]; } - (void)setSteeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle { @@ -225,7 +225,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)steeringWheelAngle { - return [parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle]; + return [parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class]; } - (void)setECallInfo:(nullable NSNumber<SDLBool> *)eCallInfo { @@ -233,7 +233,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)eCallInfo { - return [parameters sdl_objectForName:SDLRPCParameterNameECallInfo]; + return [parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:NSNumber.class]; } - (void)setAirbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus { @@ -241,7 +241,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)airbagStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:NSNumber.class]; } - (void)setEmergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent { @@ -249,7 +249,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)emergencyEvent { - return [parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent]; + return [parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:NSNumber.class]; } - (void)setClusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus { @@ -257,7 +257,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)clusterModeStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus ofClass:NSNumber.class]; } - (void)setMyKey:(nullable NSNumber<SDLBool> *)myKey { @@ -265,7 +265,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)myKey { - return [parameters sdl_objectForName:SDLRPCParameterNameMyKey]; + return [parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:NSNumber.class]; } - (void)setElectronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus { @@ -273,7 +273,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)electronicParkBrakeStatus { - return [parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus]; + return [parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus ofClass:NSNumber.class]; } - (void)setTurnSignal:(nullable NSNumber<SDLBool> *)turnSignal { @@ -281,7 +281,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)turnSignal { - return [parameters sdl_objectForName:SDLRPCParameterNameTurnSignal]; + return [parameters sdl_objectForName:SDLRPCParameterNameTurnSignal ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m index 9d440545f..2658fbb6f 100644 --- a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m +++ b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m @@ -160,7 +160,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)engineOilLife { - return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife]; + return [parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:SDLVehicleDataResult.class]; } - (void)setEngineTorque:(nullable SDLVehicleDataResult *)engineTorque { diff --git a/SmartDeviceLink/SDLVehicleDataResult.m b/SmartDeviceLink/SDLVehicleDataResult.m index 52d6225a8..2414719cc 100644 --- a/SmartDeviceLink/SDLVehicleDataResult.m +++ b/SmartDeviceLink/SDLVehicleDataResult.m @@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataType)dataType { - return [store sdl_objectForName:SDLRPCParameterNameDataType]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameDataType error:&error]; } - (void)setResultCode:(SDLVehicleDataResultCode)resultCode { @@ -23,7 +24,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVehicleDataResultCode)resultCode { - return [store sdl_objectForName:SDLRPCParameterNameResultCode]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameResultCode error:&error]; } @end diff --git a/SmartDeviceLink/SDLVehicleType.m b/SmartDeviceLink/SDLVehicleType.m index f41f5bec3..e9ae41301 100644 --- a/SmartDeviceLink/SDLVehicleType.m +++ b/SmartDeviceLink/SDLVehicleType.m @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)make { - return [store sdl_objectForName:SDLRPCParameterNameMake]; + return [store sdl_objectForName:SDLRPCParameterNameMake ofClass:NSString.class]; } - (void)setModel:(nullable NSString *)model { @@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)model { - return [store sdl_objectForName:SDLRPCParameterNameModel]; + return [store sdl_objectForName:SDLRPCParameterNameModel ofClass:NSString.class]; } - (void)setModelYear:(nullable NSString *)modelYear { @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)modelYear { - return [store sdl_objectForName:SDLRPCParameterNameModelYear]; + return [store sdl_objectForName:SDLRPCParameterNameModelYear ofClass:NSString.class]; } - (void)setTrim:(nullable NSString *)trim { @@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)trim { - return [store sdl_objectForName:SDLRPCParameterNameTrim]; + return [store sdl_objectForName:SDLRPCParameterNameTrim ofClass:NSString.class]; } @end diff --git a/SmartDeviceLink/SDLVideoStreamingCapability.m b/SmartDeviceLink/SDLVideoStreamingCapability.m index 5593c27d9..b38ac9b25 100644 --- a/SmartDeviceLink/SDLVideoStreamingCapability.m +++ b/SmartDeviceLink/SDLVideoStreamingCapability.m @@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)maxBitrate { - return [store sdl_objectForName:SDLRPCParameterNameMaxBitrate]; + return [store sdl_objectForName:SDLRPCParameterNameMaxBitrate ofClass:NSNumber.class]; } - (void)setSupportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats { @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)hapticSpatialDataSupported { - return [store sdl_objectForName:SDLRPCParameterNameHapticSpatialDataSupported]; + return [store sdl_objectForName:SDLRPCParameterNameHapticSpatialDataSupported ofClass:NSNumber.class]; } @end diff --git a/SmartDeviceLink/SDLVideoStreamingFormat.m b/SmartDeviceLink/SDLVideoStreamingFormat.m index bbae3ffca..f4ee4613a 100644 --- a/SmartDeviceLink/SDLVideoStreamingFormat.m +++ b/SmartDeviceLink/SDLVideoStreamingFormat.m @@ -25,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVideoStreamingProtocol)protocol { - return [store sdl_objectForName:SDLRPCParameterNameVideoProtocol]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameVideoProtocol error:&error]; } - (void)setProtocol:(SDLVideoStreamingProtocol)protocol { @@ -33,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN } - (SDLVideoStreamingCodec)codec { - return [store sdl_objectForName:SDLRPCParameterNameVideoCodec]; + NSError *error; + return [store sdl_enumForName:SDLRPCParameterNameVideoCodec error:&error]; } - (void)setCodec:(SDLVideoStreamingCodec)codec { diff --git a/SmartDeviceLink/SDLVrHelpItem.m b/SmartDeviceLink/SDLVrHelpItem.m index 7aa1c962f..fae9ea8fd 100644 --- a/SmartDeviceLink/SDLVrHelpItem.m +++ b/SmartDeviceLink/SDLVrHelpItem.m @@ -40,7 +40,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSString *)text { - return [store sdl_objectForName:SDLRPCParameterNameText]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNameText ofClass:NSString.class error:&error]; } - (void)setImage:(nullable SDLImage *)image { @@ -56,7 +57,8 @@ NS_ASSUME_NONNULL_BEGIN } - (NSNumber<SDLInt> *)position { - return [store sdl_objectForName:SDLRPCParameterNamePosition]; + NSError *error; + return [store sdl_objectForName:SDLRPCParameterNamePosition ofClass:NSNumber.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLWeatherAlert.m b/SmartDeviceLink/SDLWeatherAlert.m index 7568ec924..8d08284f8 100644 --- a/SmartDeviceLink/SDLWeatherAlert.m +++ b/SmartDeviceLink/SDLWeatherAlert.m @@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)title { - return [store sdl_objectForName:SDLRPCParameterNameTitle]; + return [store sdl_objectForName:SDLRPCParameterNameTitle ofClass:NSString.class]; } - (void)setSummary:(nullable NSString *)summary { @@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)summary { - return [store sdl_objectForName:SDLRPCParameterNameSummary]; + return [store sdl_objectForName:SDLRPCParameterNameSummary ofClass:NSString.class]; } - (void)setExpires:(nullable SDLDateTime *)expires { @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<NSString *> *)regions { - return [store sdl_objectForName:SDLRPCParameterNameRegions]; + return [store sdl_objectsForName:SDLRPCParameterNameRegions ofClass:NSString.class]; } - (void)setSeverity:(nullable NSString *)severity { @@ -68,7 +68,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)severity { - return [store sdl_objectForName:SDLRPCParameterNameSeverity]; + return [store sdl_objectForName:SDLRPCParameterNameSeverity ofClass:NSString.class]; } - (void)setTimeIssued:(nullable SDLDateTime *)timeIssued { diff --git a/SmartDeviceLink/SDLWeatherData.m b/SmartDeviceLink/SDLWeatherData.m index 36dd54ccc..19a51aa78 100644 --- a/SmartDeviceLink/SDLWeatherData.m +++ b/SmartDeviceLink/SDLWeatherData.m @@ -103,7 +103,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)weatherSummary { - return [store sdl_objectForName:SDLRPCParameterNameWeatherSummary]; + return [store sdl_objectForName:SDLRPCParameterNameWeatherSummary ofClass:NSString.class]; } - (void)setTime:(nullable SDLDateTime *)time { @@ -119,7 +119,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)humidity { - return [store sdl_objectForName:SDLRPCParameterNameHumidity]; + return [store sdl_objectForName:SDLRPCParameterNameHumidity ofClass:NSNumber.class]; } - (void)setCloudCover:(nullable NSNumber<SDLFloat> *)cloudCover { @@ -127,7 +127,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)cloudCover { - return [store sdl_objectForName:SDLRPCParameterNameCloudCover]; + return [store sdl_objectForName:SDLRPCParameterNameCloudCover ofClass:NSNumber.class]; } - (void)setMoonPhase:(nullable NSNumber<SDLFloat> *)moonPhase { @@ -135,7 +135,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)moonPhase { - return [store sdl_objectForName:SDLRPCParameterNameMoonPhase]; + return [store sdl_objectForName:SDLRPCParameterNameMoonPhase ofClass:NSNumber.class]; } - (void)setWindBearing:(nullable NSNumber<SDLInt> *)windBearing { @@ -143,7 +143,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)windBearing { - return [store sdl_objectForName:SDLRPCParameterNameWindBearing]; + return [store sdl_objectForName:SDLRPCParameterNameWindBearing ofClass:NSNumber.class]; } - (void)setWindGust:(nullable NSNumber<SDLFloat> *)windGust { @@ -151,7 +151,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)windGust { - return [store sdl_objectForName:SDLRPCParameterNameWindGust]; + return [store sdl_objectForName:SDLRPCParameterNameWindGust ofClass:NSNumber.class]; } - (void)setWindSpeed:(nullable NSNumber<SDLFloat> *)windSpeed { @@ -159,7 +159,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)windSpeed { - return [store sdl_objectForName:SDLRPCParameterNameWindSpeed]; + return [store sdl_objectForName:SDLRPCParameterNameWindSpeed ofClass:NSNumber.class]; } - (void)setNearestStormBearing:(nullable NSNumber<SDLInt> *)nearestStormBearing { @@ -167,7 +167,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)nearestStormBearing { - return [store sdl_objectForName:SDLRPCParameterNameNearestStormBearing]; + return [store sdl_objectForName:SDLRPCParameterNameNearestStormBearing ofClass:NSNumber.class]; } - (void)setNearestStormDistance:(nullable NSNumber<SDLInt> *)nearestStormDistance { @@ -175,7 +175,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)nearestStormDistance { - return [store sdl_objectForName:SDLRPCParameterNameNearestStormDistance]; + return [store sdl_objectForName:SDLRPCParameterNameNearestStormDistance ofClass:NSNumber.class]; } - (void)setPrecipAccumulation:(nullable NSNumber<SDLFloat> *)precipAccumulation { @@ -183,7 +183,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)precipAccumulation { - return [store sdl_objectForName:SDLRPCParameterNamePrecipAccumulation]; + return [store sdl_objectForName:SDLRPCParameterNamePrecipAccumulation ofClass:NSNumber.class]; } - (void)setPrecipIntensity:(nullable NSNumber<SDLFloat> *)precipIntensity { @@ -191,7 +191,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)precipIntensity { - return [store sdl_objectForName:SDLRPCParameterNamePrecipIntensity]; + return [store sdl_objectForName:SDLRPCParameterNamePrecipIntensity ofClass:NSNumber.class]; } - (void)setPrecipProbability:(nullable NSNumber<SDLFloat> *)precipProbability { @@ -199,7 +199,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)precipProbability { - return [store sdl_objectForName:SDLRPCParameterNamePrecipProbability]; + return [store sdl_objectForName:SDLRPCParameterNamePrecipProbability ofClass:NSNumber.class]; } - (void)setPrecipType:(nullable NSString *)precipType { @@ -207,7 +207,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)precipType { - return [store sdl_objectForName:SDLRPCParameterNamePrecipType]; + return [store sdl_objectForName:SDLRPCParameterNamePrecipType ofClass:NSString.class]; } - (void)setVisibility:(nullable NSNumber<SDLFloat> *)visibility { @@ -215,7 +215,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)visibility { - return [store sdl_objectForName:SDLRPCParameterNameVisibility]; + return [store sdl_objectForName:SDLRPCParameterNameVisibility ofClass:NSNumber.class]; } - (void)setWeatherIcon:(nullable SDLImage *)weatherIcon { diff --git a/SmartDeviceLink/SDLWeatherServiceManifest.m b/SmartDeviceLink/SDLWeatherServiceManifest.m index 7f170357e..86df7e43e 100644 --- a/SmartDeviceLink/SDLWeatherServiceManifest.m +++ b/SmartDeviceLink/SDLWeatherServiceManifest.m @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)currentForecastSupported { - return [store sdl_objectForName:SDLRPCParameterNameCurrentForecastSupported]; + return [store sdl_objectForName:SDLRPCParameterNameCurrentForecastSupported ofClass:NSNumber.class]; } - (void)setMaxMultidayForecastAmount:(nullable NSNumber<SDLInt> *)maxMultidayForecastAmount { @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)maxMultidayForecastAmount { - return [store sdl_objectForName:SDLRPCParameterNameMaxMultidayForecastAmount]; + return [store sdl_objectForName:SDLRPCParameterNameMaxMultidayForecastAmount ofClass:NSNumber.class]; } - (void)setMaxHourlyForecastAmount:(nullable NSNumber<SDLInt> *)maxHourlyForecastAmount { @@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)maxHourlyForecastAmount { - return [store sdl_objectForName:SDLRPCParameterNameMaxHourlyForecastAmount]; + return [store sdl_objectForName:SDLRPCParameterNameMaxHourlyForecastAmount ofClass:NSNumber.class]; } - (void)setMaxMinutelyForecastAmount:(nullable NSNumber<SDLInt> *)maxMinutelyForecastAmount { @@ -59,7 +59,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)maxMinutelyForecastAmount { - return [store sdl_objectForName:SDLRPCParameterNameMaxMinutelyForecastAmount]; + return [store sdl_objectForName:SDLRPCParameterNameMaxMinutelyForecastAmount ofClass:NSNumber.class]; } - (void)setWeatherForLocationSupported:(nullable NSNumber<SDLBool> *)weatherForLocationSupported { @@ -67,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)weatherForLocationSupported { - return [store sdl_objectForName:SDLRPCParameterNameWeatherForLocationSupported]; + return [store sdl_objectForName:SDLRPCParameterNameWeatherForLocationSupported ofClass:NSNumber.class]; } @end |