Options
All
  • Public
  • Public/Protected
  • All
Menu

Use this builder to construct a Tyson instance when you need to set configuration options other than the default.

Here is an example:

const tyson = new TysonBuilder()
  .registerTypeAdapter(Point, pointAdapter)
  .registerTypeAdapter(User, userAdapter)
  .enableNullsSerialization()
  .build();
export
class

TysonBuilder

Hierarchy

  • TysonBuilder

Index

Constructors

constructor

Properties

Private _factories

_factories: Array<TypeAdapterFactory>

Private _serializeNulls

_serializeNulls: boolean = Constants.DEFAULT_SERIALIZE_NULLS

Accessors

factories

factories:

serializeNulls

serializeNulls:

Methods

build

  • Returns a new instance of Tyson configured with the options currently set in this builder.

    memberof

    TysonBuilder

    Returns Tyson

    a Tyson instance

enableNullsSerialization

  • Configure Tyson to serialize null fields. By default, Tyson omits all fields that are null during serialization.

    memberof

    TysonBuilder

    Returns TysonBuilder

    a reference to this TysonBuilder

registerTypeAdapter

  • This method register a new type adapter for a specific type. You can use this to configure Tyson for custom serialization or deserialization. If a type adapter was previously registered for the specified type, it is overwritten (even the built-in).

    template

    T

    memberof

    TysonBuilder

    Type parameters

    • T

    Parameters

    Returns TysonBuilder

    a reference to this TysonBuilder

registerTypeAdapterFactory

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc