Options
All
  • Public
  • Public/Protected
  • All
Menu

Base entity for all the other entities that "mirror" the information stored by the broker.

Hierarchy

Index

Constructors

constructor

  • Constructor that creates a new base entity from a plain object received from the broker.

    Parameters

    • entity: any = {}

      The plain object received from the broker.

    Returns BaseEntity

Properties

Private _raw

_raw: any

Private raw data received from the broker.

brokerName

brokerName: string

The unique name of the broker that the entity came from.

createdAt

createdAt: Date

The date when the entity was created at the broker.

id

id: string

The entity Id

timestamp

timestamp: Date

The date when the entity was created or last updated locally.

updatedAt

updatedAt: Date

The date when the entity was updated at the broker.

Accessors

_id

  • get _id(): string
  • set _id(id: string): void
  • _id "getter" and "setter" for backwards compatibility with the default broker API.

    Returns string

  • _id "getter" and "setter" for backwards compatibility with the default broker API.

    Parameters

    • id: string

    Returns void

Protected raw

  • get raw(): any
  • set raw(raw: any): void
  • Protected "getter" and "setter" for the raw data received from the broker.

    todo

    This is currently disabled/unused. It should be removed in the future.

    Returns any

  • Protected "getter" and "setter" for the raw data received from the broker.

    Parameters

    • raw: any

    Returns void

Methods

equals

  • equals(entity: any): boolean
  • A method that compares the current object with another object to determine if their values are equivalent.

    todo
    • Add specific equals implementations to all child classes**

    Parameters

    • entity: any

      The object to compare to.

    Returns boolean

update

  • update(entity: any): void
  • A method that replaces/updates the information of the object with that of a plain object received from the broker.

    Parameters

    • entity: any

      The plain object received from the broker.

    Returns void

Generated using TypeDoc