Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
Description
Update: the Parameterizable interface was replaced with CodecProvider.get(Class<T> clazz, List<Type> typeArguments, CodecRegistry registry).
The Parameterizable interface was introduced along with RecordCodec to allow it to be deeply immutable even in the face of type parameters. We can make PojoCodec similarly immutable by having it make use of this interface. There are a few aspects to this
- PojoCodec implements Parameterizable
- PojoCodec uses CodecRegistry#get(java.lang.Class<T>, java.util.List<java.lang.reflect.Type>) to resolve codecs for parameterized POJO types, including nested POJOs and collections. Doing this for collections may be tricky since a different mechanism was introduced in
JAVA-2554that may conflict with this effort.
The end result should be that the full set of parameterized codecs is resolved before the codec is ever used for encoding or decoding.