5
我將如何生成具有以下簽名的方法?JavaPoet添加通用參數
public <T extends MyClass> void doSomething(T t)
到目前爲止,我有:
MethodSpec.methodBuilder("doSomething")
.addModifiers(Modifier.PUBLIC)
.addTypeVariable(TypeVariableName.get("T", MyClass.class))
.build()
編輯這就是上面的代碼生成(我不知道如何添加參數):
public <T extends Myclass> void doSomething()