kotlinpoet / com.squareup.kotlinpoet / FileSpec / Builder / addAnnotation

addAnnotation

fun addAnnotation(annotationSpec: AnnotationSpec): Builder

Add an annotation to the file.

The annotation must either have a file use-site target or not have a use-site target specified (in which case it will be changed to file).

fun addAnnotation(annotation: ClassName): Builder
fun addAnnotation(annotation: Class<*>): Builder
fun addAnnotation(annotation: KClass<*>): Builder