Interface ICodecBuilder
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
contentTypestringThe
datacontenttypethis form uses, e.g.application/json.decodeFunc<CloudEvent, T>Reads the event's data into
T.encodeFunc<T, CloudEvent>Writes
Tas a CloudEvent whoseDataContentTypeiscontentType.
Returns
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()