Table of Contents

Interface ICodecBuilder

Namespace
Virtufin.Worker.DevKit.Codecs
Assembly
Virtufin.Worker.DevKit.dll

Builds a ICodec from typed registrations.

public interface ICodecBuilder

Methods

Add<T>(string, Func<CloudEvent, T>, Func<T, CloudEvent>)

Register one wire form of T.

ICodecBuilder Add<T>(string contentType, Func<CloudEvent, T> decode, Func<T, CloudEvent> encode)

Parameters

contentType string

The datacontenttype this form uses, e.g. application/json.

decode Func<CloudEvent, T>

Reads the event's data into T.

encode Func<T, CloudEvent>

Writes T as a CloudEvent whose DataContentType is contentType.

Returns

ICodecBuilder

Type Parameters

T

Exceptions

CodecRegistrationException

A null delegate, an empty content type, or a duplicate (content type, T).

Build()

Build the immutable codec.

ICodec Build()

Returns

ICodec