@ SuppressWarnings ( "unchecked" ) public static < T > Serializer < T > unsafeGetSerializer ( SerializerFactory serializerFactory , SerializerDefinition serializerDefinition ) { return ( Serializer < T > ) serializerFactory . getSerializer ( serializerDefinition ) ; }
This is a temporary measure until we have a type - safe solution for retrieving serializers from a SerializerFactory . It avoids warnings all over the codebase while making it easy to verify who calls it .