register<T> function
Register custom EJSON encoder
and decoder
for a type T
.
The last registered codec pair for a given type T
will be used.
Implementation
void register<T>(EJsonEncoder<T> encoder, EJsonDecoder<T> decoder) {
TypePlus.add<T>();
customEncoders[T] = encoder;
customDecoders[T] = decoder;
}