C# Runtime  0.8
Static Public Member Functions | List of all members
alfa.rt.Codec Class Reference

The Codec class contains utility methods that encode and decode Alfa objects to and from JSON. More...

Static Public Member Functions

static string ToJsonString< T > (T alfaObject)
 Constructs a JSON representation of an Alfa object More...
 
static string toFormattedJson< T > (T alfaObject)
 Constructs a Pretty JSON representation of an Alfa object More...
 
static string ToJsonString< T > (JsonWriterCodecConfig cc, T alfaObject)
 Constructs a JSON representation of an Alfa object More...
 
static T FromJsonString< T > (string json)
 Construct an Alfa object from a JSON string More...
 
static T FromJsonString< T > (Assembly assembly, string json)
 Construct an Alfa object from a JSON string More...
 
static T FromJsonString< T > (JsonReaderCodecConfig codecConfig, string json)
 Construct an Alfa object from a JSON string More...
 

Detailed Description

The Codec class contains utility methods that encode and decode Alfa objects to and from JSON.

Member Function Documentation

◆ FromJsonString< T >() [1/3]

static T alfa.rt.Codec.FromJsonString< T > ( Assembly  assembly,
string  json 
)
inlinestatic

Construct an Alfa object from a JSON string

Parameters
assembly.NET Assembly containing target type
jsonJSON containing the string representation of the object
Template Parameters
TTarget Alfa type
Returns
An Alfa object
Type Constraints
T :AlfaObject 

◆ FromJsonString< T >() [2/3]

static T alfa.rt.Codec.FromJsonString< T > ( JsonReaderCodecConfig  codecConfig,
string  json 
)
inlinestatic

Construct an Alfa object from a JSON string

Parameters
codecConfigConfiguration for decoding
jsonJSON containing the string representation of the object
Template Parameters
TTarget Alfa type
Returns
An Alfa object
Type Constraints
T :AlfaObject 

◆ FromJsonString< T >() [3/3]

static T alfa.rt.Codec.FromJsonString< T > ( string  json)
inlinestatic

Construct an Alfa object from a JSON string

Parameters
jsonJSON containing the string representation of the object
Template Parameters
TTarget Alfa type
Returns
An Alfa object
Type Constraints
T :AlfaObject 

◆ toFormattedJson< T >()

static string alfa.rt.Codec.toFormattedJson< T > ( alfaObject)
inlinestatic

Constructs a Pretty JSON representation of an Alfa object

Parameters
alfaObjectThe Alfa object to convert
Template Parameters
TTarget Alfa type
Returns
Pretty printed JSON string representing the object
Type Constraints
T :AlfaObject 

◆ ToJsonString< T >() [1/2]

static string alfa.rt.Codec.ToJsonString< T > ( JsonWriterCodecConfig  cc,
alfaObject 
)
inlinestatic

Constructs a JSON representation of an Alfa object

Parameters
cc
alfaObjectThe Alfa object to convert
Template Parameters
TTarget Alfa type
Returns
JSON string representing the object
Type Constraints
T :AlfaObject 

◆ ToJsonString< T >() [2/2]

static string alfa.rt.Codec.ToJsonString< T > ( alfaObject)
inlinestatic

Constructs a JSON representation of an Alfa object

Parameters
alfaObjectThe Alfa object to convert
Template Parameters
TTarget Alfa type
Returns
JSON string representing the object
Type Constraints
T :AlfaObject 

The documentation for this class was generated from the following file: