private TypeToken < ? > getCallTypeToken ( TypeToken < ? > outputType , Schema schema ) { Schema . Type schemaType = schema . getType ( ) ; if ( schemaType == Schema . Type . RECORD || schemaType == Schema . Type . UNION ) { return TypeToken . of ( Object . class ) ; } if ( schemaType == Schema . Type . ARRAY && outputType . isArray ( ) ) { return getArrayType ( getCallTypeToken ( outputType . getComponentType ( ) , schema . getComponentSchema ( ) ) ) ; } return outputType ; }
Returns the type to be used on the encode method . This is needed to work with private classes that the generated DatumWriter doesn t have access to .