FMLiveSwitchJsonSerializer Class Reference

Provides methods for serializing/deserializing .NET value types to/from JSON as well as facilities for converting objects and arrays if appropriate callbacks are supplied to assist with the conversion. More...

Instance Methods

(instancetype) - init
 

Class Methods

(NSMutableArray *) + deserializeBooleanArrayWithArrayJson:
 Deserializes a boolean array from JSON. More...
 
(FMLiveSwitchNullableBool *) + deserializeBooleanWithValueJson:
 Deserializes a boolean value. More...
 
(NSMutableArray *) + deserializeDecimalArrayWithArrayJson:
 Deserializes a decimal array from JSON. More...
 
(FMLiveSwitchNullableDecimal *) + deserializeDecimalWithValueJson:
 Deserializes a decimal value. More...
 
(NSMutableDictionary< NSString *, id > *) + deserializeDictionaryWithDictionaryJson:createDictionaryCallback:deserializeValueCallback:
 Deserializes a JSON string into a dictionary. More...
 
(NSMutableDictionary< NSString *, id > *) + deserializeDictionaryWithDictionaryJson:createDictionaryCallbackBlock:deserializeValueCallbackBlock:
 Deserializes a JSON string into a dictionary. More...
 
(NSString *) + deserializeDictionaryWithDictionaryJsonAndCreateDictionaryCallbackBlockAndDeserializeValueCallbackBlock
 Deserializes a JSON string into a dictionary. More...
 
(NSMutableArray *) + deserializeDoubleArrayWithArrayJson:
 Deserializes a double array from JSON. More...
 
(FMLiveSwitchNullableDouble *) + deserializeDoubleWithValueJson:
 Deserializes a double value. More...
 
(NSMutableArray *) + deserializeFloatArrayWithArrayJson:
 Deserializes a float array from JSON. More...
 
(FMLiveSwitchNullableFloat *) + deserializeFloatWithValueJson:
 Deserializes a float value. More...
 
(NSMutableArray *) + deserializeGuidArrayWithArrayJson:
 Deserializes a GUID array from JSON. More...
 
(FMLiveSwitchNullableGuid *) + deserializeGuidWithValueJson:
 Deserializes a globally unique identifier. More...
 
(NSMutableArray *) + deserializeIntegerArrayWithArrayJson:
 Deserializes a integer array from JSON. More...
 
(FMLiveSwitchNullableInt *) + deserializeIntegerWithValueJson:
 Deserializes an integer value. More...
 
(NSMutableArray *) + deserializeLongArrayWithArrayJson:
 Deserializes a long array from JSON. More...
 
(FMLiveSwitchNullableLong *) + deserializeLongWithValueJson:
 Deserializes a long value. More...
 
(NSMutableArray< id > *) + deserializeObjectArrayWithJson:deserializer:
 Deserializes a JSON string into an array of target object types. More...
 
(NSMutableArray< id > *) + deserializeObjectArrayWithJson:deserializerBlock:
 Deserializes a JSON string into an array of target object types. More...
 
(NSString *) + deserializeObjectArrayWithJsonAndDeserializerBlock
 Deserializes a JSON string into an array of target object types. More...
 
(FMLiveSwitchSerializable *) + deserializeObjectFastWithJson:creator:callback:
 Deserializes a JSON string into a FMLiveSwitchSerializable target object type. More...
 
(FMLiveSwitchSerializable *) + deserializeObjectFastWithJson:creatorBlock:callbackBlock:
 Deserializes a JSON string into a FMLiveSwitchSerializable target object type. More...
 
(FMLiveSwitchSerializable *, NSString *, NSString *) + deserializeObjectFastWithJsonAndCreatorBlockAndCallbackBlock
 Deserializes a JSON string into a FMLiveSwitchSerializable target object type. More...
 
(id+ deserializeObjectWithJson:creator:callback:
 Deserializes a JSON string into a target object type. More...
 
(id+ deserializeObjectWithJson:creatorBlock:callbackBlock:
 Deserializes a JSON string into a target object type. More...
 
(id, NSString *, NSString *) + deserializeObjectWithJsonAndCreatorBlockAndCallbackBlock
 Deserializes a JSON string into a target object type. More...
 
(NSMutableArray< NSString * > *) + deserializeRawArrayWithJson:
 Deserializes a raw array from JSON. More...
 
(NSString *) + deserializeRawWithDataJson:
 Deserializes a piece of raw JSON. More...
 
(NSMutableArray *) + deserializeStringArrayWithArrayJson:
 Deserializes a simple string array from JSON. More...
 
(NSString *) + deserializeStringWithValueJson:
 Deserializes a string. More...
 
(NSString *) + escapeStringWithText:
 Escapes any special characters in a string. More...
 
(bool) + isValidJson:
 Determines whether the specified JSON string is valid. More...
 
(FMLiveSwitchJsonSerializer *) + jsonSerializer
 
(NSString *) + serializeBoolean:
 Serializes a boolean value. More...
 
(NSString *) + serializeBooleanArray:
 Serializes a boolean array to JSON. More...
 
(NSString *) + serializeDecimal:
 Serializes a decimal value. More...
 
(NSString *) + serializeDecimalArray:
 Serializes a decimal array to JSON. More...
 
(NSString *) + serializeDictionary:serializeValueCallback:
 Serializes a dictionary into a JSON string. More...
 
(NSString *) + serializeDictionary:serializeValueCallbackBlock:
 Serializes a dictionary into a JSON string. More...
 
(id+ serializeDictionaryAndSerializeValueCallbackBlock
 Serializes a dictionary into a JSON string. More...
 
(NSString *) + serializeDouble:
 Serializes a double value. More...
 
(NSString *) + serializeDoubleArray:
 Serializes a double array to JSON. More...
 
(NSString *) + serializeFloat:
 Serializes a float value. More...
 
(NSString *) + serializeFloatArray:
 Serializes a float array to JSON. More...
 
(NSString *) + serializeGuid:
 Serializes a globally unique identifier. More...
 
(NSString *) + serializeGuidArray:
 Serializes a GUID array to JSON. More...
 
(NSString *) + serializeInteger:
 Serializes an integer value. More...
 
(NSString *) + serializeIntegerArray:
 Serializes a integer array to JSON. More...
 
(NSString *) + serializeLong:
 Serializes a long value. More...
 
(NSString *) + serializeLongArray:
 Serializes a long array to JSON. More...
 
(NSString *) + serializeObjectArrayWithObjects:serializer:
 Serializes an object array into a JSON string. More...
 
(NSString *) + serializeObjectArrayWithObjects:serializerBlock:
 Serializes an object array into a JSON string. More...
 
(id+ serializeObjectArrayWithObjectsAndSerializerBlock
 Serializes an object array into a JSON string. More...
 
(NSString *) + serializeObjectFastWithSource:callback:
 Serializes a FMLiveSwitchSerializable object into a JSON string. More...
 
(NSString *) + serializeObjectFastWithSource:callbackBlock:
 Serializes a FMLiveSwitchSerializable object into a JSON string. More...
 
(FMLiveSwitchSerializable *, NSMutableDictionary< NSString *, NSString * > *) + serializeObjectFastWithSourceAndCallbackBlock
 Serializes a FMLiveSwitchSerializable object into a JSON string. More...
 
(NSString *) + serializeObjectWithSource:callback:
 Serializes an object into a JSON string. More...
 
(NSString *) + serializeObjectWithSource:callbackBlock:
 Serializes an object into a JSON string. More...
 
(id, NSMutableDictionary< NSString *, NSString * > *) + serializeObjectWithSourceAndCallbackBlock
 Serializes an object into a JSON string. More...
 
(NSString *) + serializeRawArrayWithJsons:
 Serializes a raw array to JSON. More...
 
(NSString *) + serializeRawWithDataJson:
 Serializes a piece of raw JSON. More...
 
(NSString *) + serializeString:
 Serializes a string. More...
 
(NSString *) + serializeStringArray:
 Serializes a string array to JSON. More...
 
(NSString *) + trimQuotes:
 Trims the quotes from a JavaScript string value. More...
 
(NSString *) + unescapeStringWithText:
 Unescapes any special characters from a string. More...
 

Detailed Description

Provides methods for serializing/deserializing .NET value types to/from JSON as well as facilities for converting objects and arrays if appropriate callbacks are supplied to assist with the conversion.

Method Documentation

◆ deserializeBooleanArrayWithArrayJson:

+ (NSMutableArray*) deserializeBooleanArrayWithArrayJson: (NSString *)  arrayJson

Deserializes a boolean array from JSON.

Parameters
arrayJsonA JSON-serialized boolean array.
Returns
An array of boolean values.

◆ deserializeBooleanWithValueJson:

+ (FMLiveSwitchNullableBool*) deserializeBooleanWithValueJson: (NSString *)  valueJson

Deserializes a boolean value.

Parameters
valueJsonThe boolean JSON to deserialize.
Returns
The deserialized boolean value.

◆ deserializeDecimalArrayWithArrayJson:

+ (NSMutableArray*) deserializeDecimalArrayWithArrayJson: (NSString *)  arrayJson

Deserializes a decimal array from JSON.

Parameters
arrayJsonA JSON-serialized decimal array.
Returns
An array of decimal values.

◆ deserializeDecimalWithValueJson:

+ (FMLiveSwitchNullableDecimal*) deserializeDecimalWithValueJson: (NSString *)  valueJson

Deserializes a decimal value.

Parameters
valueJsonThe decimal JSON to deserialize.
Returns
The deserialized decimal value.

◆ deserializeDictionaryWithDictionaryJson:createDictionaryCallback:deserializeValueCallback:

+ (NSMutableDictionary<NSString*,id>*) deserializeDictionaryWithDictionaryJson: (NSString *)  dictionaryJson
createDictionaryCallback: (FMLiveSwitchFunction0< NSMutableDictionary< NSString *, id > * > *)  createDictionaryCallback
deserializeValueCallback: (FMLiveSwitchFunction1< NSString *, id > *)  deserializeValueCallback 

Deserializes a JSON string into a dictionary.

Parameters
dictionaryJsonThe JSON-encoded dictionary.
createDictionaryCallbackThe callback that creates a blank dictionary.
deserializeValueCallbackThe callback that deserializes a value.
Returns
The deserialized dictionary.

◆ deserializeDictionaryWithDictionaryJson:createDictionaryCallbackBlock:deserializeValueCallbackBlock:

+ (NSMutableDictionary<NSString*,id>*) deserializeDictionaryWithDictionaryJson: (NSString *)  dictionaryJson
createDictionaryCallbackBlock: (NSMutableDictionary< NSString *, id > *(^)(void))  createDictionaryCallbackBlock
deserializeValueCallbackBlock: (id(^)(NSString *))  deserializeValueCallbackBlock 

Deserializes a JSON string into a dictionary.

Parameters
dictionaryJsonThe JSON-encoded dictionary.
createDictionaryCallbackBlockThe callback that creates a blank dictionary.
deserializeValueCallbackBlockThe callback that deserializes a value.
Returns
The deserialized dictionary.

◆ deserializeDictionaryWithDictionaryJsonAndCreateDictionaryCallbackBlockAndDeserializeValueCallbackBlock

+ (NSString*) deserializeDictionaryWithDictionaryJsonAndCreateDictionaryCallbackBlockAndDeserializeValueCallbackBlock

Deserializes a JSON string into a dictionary.

@inlineparam dictionaryJson The JSON-encoded dictionary. @inlineparam createDictionaryCallbackBlock The callback that creates a blank dictionary. @inlineparam deserializeValueCallbackBlock The callback that deserializes a value.

Returns
The deserialized dictionary.

◆ deserializeDoubleArrayWithArrayJson:

+ (NSMutableArray*) deserializeDoubleArrayWithArrayJson: (NSString *)  arrayJson

Deserializes a double array from JSON.

Parameters
arrayJsonA JSON-serialized double array.
Returns
An array of double values.

◆ deserializeDoubleWithValueJson:

+ (FMLiveSwitchNullableDouble*) deserializeDoubleWithValueJson: (NSString *)  valueJson

Deserializes a double value.

Parameters
valueJsonThe double JSON to deserialize.
Returns
The deserialized double value.

◆ deserializeFloatArrayWithArrayJson:

+ (NSMutableArray*) deserializeFloatArrayWithArrayJson: (NSString *)  arrayJson

Deserializes a float array from JSON.

Parameters
arrayJsonA JSON-serialized float array.
Returns
An array of float values.

◆ deserializeFloatWithValueJson:

+ (FMLiveSwitchNullableFloat*) deserializeFloatWithValueJson: (NSString *)  valueJson

Deserializes a float value.

Parameters
valueJsonThe float JSON to deserialize.
Returns
The deserialized float value.

◆ deserializeGuidArrayWithArrayJson:

+ (NSMutableArray*) deserializeGuidArrayWithArrayJson: (NSString *)  arrayJson

Deserializes a GUID array from JSON.

Parameters
arrayJsonA JSON-serialized GUID array.
Returns
An array of GUID values.

◆ deserializeGuidWithValueJson:

+ (FMLiveSwitchNullableGuid*) deserializeGuidWithValueJson: (NSString *)  valueJson

Deserializes a globally unique identifier.

Parameters
valueJsonThe GUID JSON to deserialize.
Returns
The deserialized GUID.

◆ deserializeIntegerArrayWithArrayJson:

+ (NSMutableArray*) deserializeIntegerArrayWithArrayJson: (NSString *)  arrayJson

Deserializes a integer array from JSON.

Parameters
arrayJsonA JSON-serialized integer array.
Returns
An array of integer values.

◆ deserializeIntegerWithValueJson:

+ (FMLiveSwitchNullableInt*) deserializeIntegerWithValueJson: (NSString *)  valueJson

Deserializes an integer value.

Parameters
valueJsonThe integer JSON to deserialize.
Returns
The deserialized integer value.

◆ deserializeLongArrayWithArrayJson:

+ (NSMutableArray*) deserializeLongArrayWithArrayJson: (NSString *)  arrayJson

Deserializes a long array from JSON.

Parameters
arrayJsonA JSON-serialized long array.
Returns
An array of long values.

◆ deserializeLongWithValueJson:

+ (FMLiveSwitchNullableLong*) deserializeLongWithValueJson: (NSString *)  valueJson

Deserializes a long value.

Parameters
valueJsonThe long JSON to deserialize.
Returns
The deserialized long value.

◆ deserializeObjectArrayWithJson:deserializer:

+ (NSMutableArray<id>*) deserializeObjectArrayWithJson: (NSString *)  json
deserializer: (FMLiveSwitchFunction1< NSString *, id > *)  deserializer 

Deserializes a JSON string into an array of target object types.

Parameters
jsonThe JSON-encoded string.
deserializerThe callback used to deserialize each item in the array.
Returns
An array of deserialized objects.

◆ deserializeObjectArrayWithJson:deserializerBlock:

+ (NSMutableArray<id>*) deserializeObjectArrayWithJson: (NSString *)  json
deserializerBlock: (id(^)(NSString *))  deserializerBlock 

Deserializes a JSON string into an array of target object types.

Parameters
jsonThe JSON-encoded string.
deserializerBlockThe callback used to deserialize each item in the array.
Returns
An array of deserialized objects.

◆ deserializeObjectArrayWithJsonAndDeserializerBlock

+ (NSString*) deserializeObjectArrayWithJsonAndDeserializerBlock

Deserializes a JSON string into an array of target object types.

@inlineparam json The JSON-encoded string. @inlineparam deserializerBlock The callback used to deserialize each item in the array.

Returns
An array of deserialized objects.

◆ deserializeObjectFastWithJson:creator:callback:

+ (FMLiveSwitchSerializable*) deserializeObjectFastWithJson: (NSString *)  json
creator: (FMLiveSwitchFunction0< FMLiveSwitchSerializable * > *)  creator
callback: (FMLiveSwitchAction3< FMLiveSwitchSerializable *, NSString *, NSString * > *)  callback 

Deserializes a JSON string into a FMLiveSwitchSerializable target object type.

Parameters
jsonThe JSON-encoded string.
creatorThe method used for creating a new object.
callbackThe method used for deserializing a property.
Returns
The deserialized object.

◆ deserializeObjectFastWithJson:creatorBlock:callbackBlock:

+ (FMLiveSwitchSerializable*) deserializeObjectFastWithJson: (NSString *)  json
creatorBlock: (FMLiveSwitchSerializable *(^)(void))  creatorBlock
callbackBlock: (void(^)(FMLiveSwitchSerializable *, NSString *, NSString *))  callbackBlock 

Deserializes a JSON string into a FMLiveSwitchSerializable target object type.

Parameters
jsonThe JSON-encoded string.
creatorBlockThe method used for creating a new object.
callbackBlockThe method used for deserializing a property.
Returns
The deserialized object.

◆ deserializeObjectFastWithJsonAndCreatorBlockAndCallbackBlock

+ (FMLiveSwitchSerializable*, NSString*, NSString*) deserializeObjectFastWithJsonAndCreatorBlockAndCallbackBlock

Deserializes a JSON string into a FMLiveSwitchSerializable target object type.

@inlineparam json The JSON-encoded string. @inlineparam creatorBlock The method used for creating a new object. @inlineparam callbackBlock The method used for deserializing a property.

Returns
The deserialized object.

◆ deserializeObjectWithJson:creator:callback:

+ (id) deserializeObjectWithJson: (NSString *)  json
creator: (FMLiveSwitchFunction0< id > *)  creator
callback: (FMLiveSwitchAction3< id, NSString *, NSString * > *)  callback 

Deserializes a JSON string into a target object type.

Parameters
jsonThe JSON-encoded string.
creatorThe method used for creating a new object.
callbackThe method used for deserializing a property.
Returns
The deserialized object.

◆ deserializeObjectWithJson:creatorBlock:callbackBlock:

+ (id) deserializeObjectWithJson: (NSString *)  json
creatorBlock: (id(^)(void))  creatorBlock
callbackBlock: (void(^)(id, NSString *, NSString *))  callbackBlock 

Deserializes a JSON string into a target object type.

Parameters
jsonThe JSON-encoded string.
creatorBlockThe method used for creating a new object.
callbackBlockThe method used for deserializing a property.
Returns
The deserialized object.

◆ deserializeObjectWithJsonAndCreatorBlockAndCallbackBlock

+ (id, NSString*, NSString*) deserializeObjectWithJsonAndCreatorBlockAndCallbackBlock

Deserializes a JSON string into a target object type.

@inlineparam json The JSON-encoded string. @inlineparam creatorBlock The method used for creating a new object. @inlineparam callbackBlock The method used for deserializing a property.

Returns
The deserialized object.

◆ deserializeRawArrayWithJson:

+ (NSMutableArray<NSString*>*) deserializeRawArrayWithJson: (NSString *)  json

Deserializes a raw array from JSON.

Parameters
jsonA JSON-serialized raw array.
Returns
An array of raw values.

◆ deserializeRawWithDataJson:

+ (NSString*) deserializeRawWithDataJson: (NSString *)  dataJson

Deserializes a piece of raw JSON.

Parameters
dataJsonThe raw data.
Returns
The deserialized data.

◆ deserializeStringArrayWithArrayJson:

+ (NSMutableArray*) deserializeStringArrayWithArrayJson: (NSString *)  arrayJson

Deserializes a simple string array from JSON.

Parameters
arrayJsonA JSON-serialized string array.
Returns
An array of string values.

◆ deserializeStringWithValueJson:

+ (NSString*) deserializeStringWithValueJson: (NSString *)  valueJson

Deserializes a string.

Parameters
valueJsonThe string to deserialize.
Returns
The deserialized string value.

◆ escapeStringWithText:

+ (NSString*) escapeStringWithText: (NSString *)  text

Escapes any special characters in a string.

Parameters
textThe string without escaped characters.
Returns
The escaped string.

◆ init

- (instancetype) init

Implemented in FMLiveSwitchSerializer.

◆ isValidJson:

+ (bool) isValidJson: (NSString *)  json

Determines whether the specified JSON string is valid.

Parameters
jsonThe JSON string to validate.
Returns
True if the JSON string is valid; false otherwise.

◆ jsonSerializer

+ (FMLiveSwitchJsonSerializer*) jsonSerializer

◆ serializeBoolean:

+ (NSString*) serializeBoolean: (FMLiveSwitchNullableBool *)  value

Serializes a boolean value.

Parameters
valueThe boolean to serialize.
Returns
The serialized boolean value.

◆ serializeBooleanArray:

+ (NSString*) serializeBooleanArray: (NSMutableArray *)  array

Serializes a boolean array to JSON.

Parameters
arrayAn array of boolean values.
Returns
A JSON-serialized boolean array.

◆ serializeDecimal:

+ (NSString*) serializeDecimal: (FMLiveSwitchNullableDecimal *)  value

Serializes a decimal value.

Parameters
valueThe decimal to serialize.
Returns
The serialized decimal value.

◆ serializeDecimalArray:

+ (NSString*) serializeDecimalArray: (NSMutableArray *)  array

Serializes a decimal array to JSON.

Parameters
arrayAn array of decimal values.
Returns
A JSON-serialized decimal array.

◆ serializeDictionary:serializeValueCallback:

+ (NSString*) serializeDictionary: (NSMutableDictionary< NSString *, id > *)  dictionary
serializeValueCallback: (FMLiveSwitchFunction1< id, NSString * > *)  serializeValueCallback 

Serializes a dictionary into a JSON string.

Parameters
dictionaryThe dictionary being serialized.
serializeValueCallbackThe callback that serializes a value.
Returns
The dictionary as a JSON string.

◆ serializeDictionary:serializeValueCallbackBlock:

+ (NSString*) serializeDictionary: (NSMutableDictionary< NSString *, id > *)  dictionary
serializeValueCallbackBlock: (NSString *(^)(id))  serializeValueCallbackBlock 

Serializes a dictionary into a JSON string.

Parameters
dictionaryThe dictionary being serialized.
serializeValueCallbackBlockThe callback that serializes a value.
Returns
The dictionary as a JSON string.

◆ serializeDictionaryAndSerializeValueCallbackBlock

+ (id) serializeDictionaryAndSerializeValueCallbackBlock

Serializes a dictionary into a JSON string.

@inlineparam dictionary The dictionary being serialized. @inlineparam serializeValueCallbackBlock The callback that serializes a value.

Returns
The dictionary as a JSON string.

◆ serializeDouble:

+ (NSString*) serializeDouble: (FMLiveSwitchNullableDouble *)  value

Serializes a double value.

Parameters
valueThe double to serialize.
Returns
The serialized double value.

◆ serializeDoubleArray:

+ (NSString*) serializeDoubleArray: (NSMutableArray *)  array

Serializes a double array to JSON.

Parameters
arrayAn array of double values.
Returns
A JSON-serialized double array.

◆ serializeFloat:

+ (NSString*) serializeFloat: (FMLiveSwitchNullableFloat *)  value

Serializes a float value.

Parameters
valueThe float to serialize.
Returns
The serialized float value.

◆ serializeFloatArray:

+ (NSString*) serializeFloatArray: (NSMutableArray *)  array

Serializes a float array to JSON.

Parameters
arrayAn array of float values.
Returns
A JSON-serialized float array.

◆ serializeGuid:

+ (NSString*) serializeGuid: (FMLiveSwitchNullableGuid *)  value

Serializes a globally unique identifier.

Parameters
valueThe GUID to serialize.
Returns
The serialized GUID.

◆ serializeGuidArray:

+ (NSString*) serializeGuidArray: (NSMutableArray *)  array

Serializes a GUID array to JSON.

Parameters
arrayAn array of GUID values.
Returns
A JSON-serialized GUID array.

◆ serializeInteger:

+ (NSString*) serializeInteger: (FMLiveSwitchNullableInt *)  value

Serializes an integer value.

Parameters
valueThe integer to serialize.
Returns
The serialized integer value.

◆ serializeIntegerArray:

+ (NSString*) serializeIntegerArray: (NSMutableArray *)  array

Serializes a integer array to JSON.

Parameters
arrayAn array of integer values.
Returns
A JSON-serialized integer array.

◆ serializeLong:

+ (NSString*) serializeLong: (FMLiveSwitchNullableLong *)  value

Serializes a long value.

Parameters
valueThe long to serialize.
Returns
The serialized long value.

◆ serializeLongArray:

+ (NSString*) serializeLongArray: (NSMutableArray *)  array

Serializes a long array to JSON.

Parameters
arrayAn array of long values.
Returns
A JSON-serialized long array.

◆ serializeObjectArrayWithObjects:serializer:

+ (NSString*) serializeObjectArrayWithObjects: (NSMutableArray *)  objects
serializer: (FMLiveSwitchFunction1< id, NSString * > *)  serializer 

Serializes an object array into a JSON string.

Parameters
objectsThe object array being serialized.
serializerThe callback used to serialize each item in the array.
Returns
The object array as a JSON string.

◆ serializeObjectArrayWithObjects:serializerBlock:

+ (NSString*) serializeObjectArrayWithObjects: (NSMutableArray *)  objects
serializerBlock: (NSString *(^)(id))  serializerBlock 

Serializes an object array into a JSON string.

Parameters
objectsThe object array being serialized.
serializerBlockThe callback used to serialize each item in the array.
Returns
The object array as a JSON string.

◆ serializeObjectArrayWithObjectsAndSerializerBlock

+ (id) serializeObjectArrayWithObjectsAndSerializerBlock

Serializes an object array into a JSON string.

@inlineparam objects The object array being serialized. @inlineparam serializerBlock The callback used to serialize each item in the array.

Returns
The object array as a JSON string.

◆ serializeObjectFastWithSource:callback:

+ (NSString*) serializeObjectFastWithSource: (FMLiveSwitchSerializable *)  source
callback: (FMLiveSwitchAction2< FMLiveSwitchSerializable *, NSMutableDictionary< NSString *, NSString * > * > *)  callback 

Serializes a FMLiveSwitchSerializable object into a JSON string.

Parameters
sourceThe object being serialized.
callbackThe method used for serializing properties.
Returns
The object as a JSON string.

◆ serializeObjectFastWithSource:callbackBlock:

+ (NSString*) serializeObjectFastWithSource: (FMLiveSwitchSerializable *)  source
callbackBlock: (void(^)(FMLiveSwitchSerializable *, NSMutableDictionary< NSString *, NSString * > *))  callbackBlock 

Serializes a FMLiveSwitchSerializable object into a JSON string.

Parameters
sourceThe object being serialized.
callbackBlockThe method used for serializing properties.
Returns
The object as a JSON string.

◆ serializeObjectFastWithSourceAndCallbackBlock

+ (FMLiveSwitchSerializable*, NSMutableDictionary<NSString*,NSString*>*) serializeObjectFastWithSourceAndCallbackBlock

Serializes a FMLiveSwitchSerializable object into a JSON string.

@inlineparam source The object being serialized. @inlineparam callbackBlock The method used for serializing properties.

Returns
The object as a JSON string.

◆ serializeObjectWithSource:callback:

+ (NSString*) serializeObjectWithSource: (id source
callback: (FMLiveSwitchAction2< id, NSMutableDictionary< NSString *, NSString * > * > *)  callback 

Serializes an object into a JSON string.

Parameters
sourceThe object being serialized.
callbackThe method used for serializing properties.
Returns
The object as a JSON string.

◆ serializeObjectWithSource:callbackBlock:

+ (NSString*) serializeObjectWithSource: (id source
callbackBlock: (void(^)(id, NSMutableDictionary< NSString *, NSString * > *))  callbackBlock 

Serializes an object into a JSON string.

Parameters
sourceThe object being serialized.
callbackBlockThe method used for serializing properties.
Returns
The object as a JSON string.

◆ serializeObjectWithSourceAndCallbackBlock

+ (id, NSMutableDictionary<NSString*,NSString*>*) serializeObjectWithSourceAndCallbackBlock

Serializes an object into a JSON string.

@inlineparam source The object being serialized. @inlineparam callbackBlock The method used for serializing properties.

Returns
The object as a JSON string.

◆ serializeRawArrayWithJsons:

+ (NSString*) serializeRawArrayWithJsons: (NSMutableArray *)  jsons

Serializes a raw array to JSON.

Parameters
jsonsAn array of raw values.
Returns
A JSON-serialized raw array.

◆ serializeRawWithDataJson:

+ (NSString*) serializeRawWithDataJson: (NSString *)  dataJson

Serializes a piece of raw JSON.

Parameters
dataJsonThe raw data.
Returns
The serialized data.

◆ serializeString:

+ (NSString*) serializeString: (NSString *)  value

Serializes a string.

Parameters
valueThe string to serialize.
Returns
The serialized string value.

◆ serializeStringArray:

+ (NSString*) serializeStringArray: (NSMutableArray *)  array

Serializes a string array to JSON.

Parameters
arrayAn array of string values.
Returns
A JSON-serialized string array.

◆ trimQuotes:

+ (NSString*) trimQuotes: (NSString *)  value

Trims the quotes from a JavaScript string value.

Parameters
valueThe JavaScript string value.
Returns
The string without quotes.

◆ unescapeStringWithText:

+ (NSString*) unescapeStringWithText: (NSString *)  text

Unescapes any special characters from a string.

Parameters
textThe string with escaped characters.
Returns
The unescaped string.