Javapoet superclass generic
问题 Anyone know how I can do the following using javapoet public class MyClassGenerated extends MyMapper<OtherClass>{ } My code of generation: TypeSpec generateClass() { return classBuilder("MyClassGenerated") .addModifiers(PUBLIC) .superclass(???????????????) .build(); } 回答1: The ParameterizedTypeName class allows you to specify generic type arguments when declaring the super class. For instance, if your MyClassGenerated class is a subclass of the MyMapper class, you can set a generic type