I want to generate a kotlin class definition, this class implements an customized interface, the target class definition as below:
data class TemplateState(val data: String) : ContractState {
}
I used below poet code to generate it except the interface part, anyone can help?
val file = FileSpec.builder("com.template", "StatesAndContracts")
.addType(TypeSpec.classBuilder("TemplateState")
.addModifiers(KModifier.DATA)
.primaryConstructor(FunSpec.constructorBuilder()
.addParameter("data", String::class)
.build())
.addProperty(PropertySpec.builder("data", String::class)
.initializer("data")
.build())
.build())
.build()