Serializable
A base class that implements ISerializable, providing functionality to serialize an object's properties to an array or a JSON string, including nested objects that implement the ISerializable interface.
Extended by
Implements
Constructors
new Serializable()
new Serializable():
Serializable
Returns
Methods
toArray()
toArray():
any
[]
Converts the object's properties to an array. If any of the properties
are objects that implement ISerializable, their toArray
method is called.
Returns
any
[]
An array representation of the object's properties.
Implementation of
Defined in
toJson()
toJson():
string
Converts the object to a JSON string. If any of the properties
are objects that implement ISerializable, their toJson
method is called.
Underscores e.g. of private members are trimmed when setting the serialized name.
Returns
string
A JSON string representation of the object.