Class: SimpleObject

Newton.SimpleObject

new SimpleObject()

SimpleObject
Source:

Methods

(static) fromJSONObject(obj) → {SimpleObject}

Create a SimpleObject instance from an object
Parameters:
Name Type Description
obj Object The object you would convert
Source:
Throws:
Will throw if the conversion is not possible
Returns:
Type
SimpleObject

(static) fromJSONString(str) → {SimpleObject}

Create a SimpleObject instance from a string
Parameters:
Name Type Description
str String The object you would convert
Source:
Throws:
Will throw if the conversion is not possible
Returns:
Type
SimpleObject

(private) _set(key, value)

Never use directly. Use the alias instead
Parameters:
Name Type Description
key String The key
value String | null | Number | Boolean The value
Source:

setBool(key, value)

Set a boolan value
Parameters:
Name Type Description
key String The key
value Integer The value
Source:

setFloat(key, value)

Set a float value
Parameters:
Name Type Description
key String The key
value Integer The value
Source:

setInt(key, value)

Set an integer value
Parameters:
Name Type Description
key String The key
value Integer The value
Source:

setNull(key, value)

Set the value to null
Parameters:
Name Type Description
key String The key
value Integer The value
Source:

setString(key, value)

Set a string value
Parameters:
Name Type Description
key String The key
value String The value
Source:

toJSONObject() → {Object}

Return an object with all set values
Source:
Returns:
The object stored in this SimpleObject
Type
Object

toJSONString() → {String}

Return an json representation
Source:
Returns:
Type
String