title: How to generate a class with a custom interface via kotlinpoet
body: <p>I want to generate a kotlin class definition, this class implements an customized interface, the target class definition as below:</p>
  
  <pre><code>data class TemplateState(val data: String) : ContractState {
  }
  </code></pre>
  
  <p>I used below poet code to generate it except the interface part, anyone can help?</p>
  
  <pre><code>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()
  </code></pre>