How would I generate a method with the following signature?
public <T extends MyClass> void doSomething(T t)
So far I have:
MethodSpec.methodBuilder("doSomething")
.addModifiers(Modifier.PUBLIC)
.addTypeVariable(TypeVariableName.get("T", MyClass.class))
.build()
EDIT This is what the above code is generating (I don't know how to add the parameter):
public <T extends Myclass> void doSomething()
Extract the
TypeVariableName
you generate into a variable so you can reuse its valueThen add a parameter of that type