public <FROM, TO> T withRuntimeCodec(CodecSignature<FROM, TO> codecSignature, Codec<FROM, TO> codec) {
        if (!configMap.containsKey(RUNTIME_CODECS)) {
            configMap.put(RUNTIME_CODECS, new HashMap<CodecSignature<?, ?>, Codec<?, ?>>());
        }
        configMap.<Map<CodecSignature<?, ?>, Codec<?, ?>>>getTyped(RUNTIME_CODECS).put(codecSignature, codec);
        return getThis();
    }
public < FROM , TO > T withRuntimeCodec ( CodecSignature < FROM , TO > codecSignature , Codec < FROM , TO > codec ) { if ( ! configMap . containsKey ( RUNTIME_CODECS ) ) { configMap . put ( RUNTIME_CODECS , new HashMap < CodecSignature < ? , ? > , Codec < ? , ? > > ( ) ) ; } configMap . < Map < CodecSignature < ? , ? > , Codec < ? , ? > > > getTyped ( RUNTIME_CODECS ) . put ( codecSignature , codec ) ; return getThis ( ) ; }
Specify a runtime codec to register with Achilles
<br/>
<pre class="code"><code class="java">

<strong>final Codec&lt;MyBean, String&gt; beanCodec = new .... // Create your codec with initialization logic here</strong>
<strong>final Codec&lt;MyEnum, String&gt; enumCodec = new .... // Create your codec with initialization logic here</strong>

final CodecSignature&lt;MyBean, String&gt; codecSignature1 = new CodecSignature(MyBean.class, String.class);
final CodecSignature&lt;MyBean, String&gt; codecSignature2 = new CodecSignature(MyEnum.class, String.class);

final Map&lt;CodecSignature&lt;?, ?&gt;, Codec&lt;?, ?&gt;&gt; runtimeCodecs = new HashMap&lt;&gt;();
runtimeCodecs.put(codecSignature1, beanCodec);
runtimeCodecs.put(codecSignature2, enumCodec);


ManagerFactory factory = ManagerFactoryBuilder
.builder(cluster)
...
<strong>.withRuntimeCodec(codecSignature1, beanCodec)</strong>
<strong>.withRuntimeCodec(codecSignature2, enumCodec)</strong>
.build();
</code></pre>
<br/>
<br/>
<em>Remark: you can call this method as many time as there are runtime codecs to be registered</em>
@param codecSignature codec signature, defined by sourceType,targetType and optionally codecName
@param codec runtime codec
@return ManagerFactoryBuilder