Skip to main content

Class: DefaultPayloadConverter

common.DefaultPayloadConverter

Hierarchy

Constructors

constructor

new DefaultPayloadConverter()

Overrides

CompositePayloadConverter.constructor

Properties

converterByEncoding

Readonly converterByEncoding: Map<string, PayloadConverterWithEncoding>

Inherited from

CompositePayloadConverter.converterByEncoding


converters

Readonly converters: PayloadConverterWithEncoding[]

Inherited from

CompositePayloadConverter.converters

Methods

fromPayload

fromPayload<T>(payload): T

Run PayloadConverterWithEncoding.fromPayload based on the encoding type of the Payload.

Type parameters

Name
T

Parameters

NameType
payloadIPayload

Returns

T

Inherited from

CompositePayloadConverter.fromPayload


toPayload

toPayload<T>(value): undefined | IPayload

Tries to run .toPayload(value) on each converter in the order provided at construction. Returns the first successful result, or undefined if there is no converter that can handle the value.

Type parameters

Name
T

Parameters

NameType
valueT

Returns

undefined | IPayload

Inherited from

CompositePayloadConverter.toPayload