我想生成一个实现接口Hello
的类Greetable<String>
public class Hello implements Greeting<String> {
@Override
public String greet() { return "Hello"; }
}
我现在如何添加界面
TypeSpec.Builder builder = TypeSpec.classBuilder(ClassName.get("a.b.c", "Hello"))
.addModifiers(PUBLIC)
.addSuperinterface(ClassName.get("a.b.c", "Greeting"));
这将导致
public class Hello implements Greeting { ... }
但是如何将<String>
添加到此界面?