Namespace: serial

gpf. serial

Root namespace for the serialization helpers.

Since:
  • 0.2.8

Members


<static, readonly> types :enum

Serializable types enumeration

Type:
  • enum
Properties:
Name Type Description
string enum

String

integer enum

Integer

datetime enum

Date/Time

Since:
  • 0.2.8

Methods


<static> fromRaw(instance, raw [, converter])

Initialize the given instance from a dictionary containing serializable properties' value.

Parameters:
Name Type Argument Description
instance Object

Instance of a class containing {@ling gpf.attributes.Serializable} attributes

raw Object

Dictionary with all serializable properties (indexed by property names)

converter gpf.typedef.serialConverter <optional>

Converter function for properties' value

Since:
  • 0.2.8
Throws:
Returns:

instance

Type
Object

<static> get(objectOrClass)

Collect gpf.typedef.serializableProperty defined for the object / class

Parameters:
Name Type Description
objectOrClass Object | function

Object instance or class constructor

Since:
  • 0.2.8
Returns:

Dictionary of gpf.typedef.serializableProperty index by member

Type
Object

<static> toRaw(instance [, converter])

Converts the given instance a simpler dictionary containing only serializable properties' value.

Parameters:
Name Type Argument Description
instance Object

Instance of a class containing {@ling gpf.attributes.Serializable} attributes

converter gpf.typedef.serialConverter <optional>

Converter function for properties' value

Since:
  • 0.2.8
Throws:
Returns:

A dictionary with all serializable properties (indexed by property names)

Type
Object