kotlinpoet / com.squareup.kotlinpoet / KotlinFile

KotlinFile

class KotlinFile

A Kotlin file containing top level objects like classes, objects, functions, properties, and type aliases.

Types

Builder class Builder

Properties

fileComment val fileComment: CodeBlock
fileName val fileName: String
members val members: List<Any>
packageName val packageName: String
skipJavaLangImports val skipJavaLangImports: Boolean

Functions

equals fun equals(other: Any?): Boolean
hashCode fun hashCode(): Int
toBuilder fun toBuilder(): Builder
toJavaFileObject fun toJavaFileObject(): JavaFileObject
toString fun toString(): String
writeTo fun writeTo(out: Appendable): Unitfun writeTo(directory: Path): Unit
fun writeTo(directory: File): Unit

Writes this to directory as UTF-8 using the standard directory structure.

fun writeTo(filer: Filer): Unit

Writes this to filer.

Companion Object Functions

builder fun builder(packageName: String, fileName: String): Builder
get fun get(packageName: String, typeSpec: TypeSpec): KotlinFile