Methods
(static) fromJSONObject(obj) → {SimpleObject}
Create a SimpleObject instance from a plain object
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object
|
The object you would convert |
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 |
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 |
setBool(key, value)
Set a boolan value
Parameters:
Name | Type | Description |
---|---|---|
key |
String
|
The key |
value |
Integer
|
The value |
setFloat(key, value)
Set a float value
Parameters:
Name | Type | Description |
---|---|---|
key |
String
|
The key |
value |
Integer
|
The value |
setInt(key, value)
Set an integer value
Parameters:
Name | Type | Description |
---|---|---|
key |
String
|
The key |
value |
Integer
|
The value |
setNull(key, value)
Set the value to null
Parameters:
Name | Type | Description |
---|---|---|
key |
String
|
The key |
value |
Integer
|
The value |
setString(key, value)
Set a string value
Parameters:
Name | Type | Description |
---|---|---|
key |
String
|
The key |
value |
String
|
The value |
toJSONObject() → {Object}
Return an object with all set values
Returns:
- Type:
-
Object
The object stored in this SimpleObject