Skip to content

Commit

Permalink
add kdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
jangalinski committed Sep 11, 2024
1 parent 48119a9 commit ada9b8c
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ class KotlinAnnotationClassSpecBuilder internal constructor(

companion object {

/**
* Creates new builder.
*/
fun builder(name: String): KotlinAnnotationClassSpecBuilder = builder(simpleClassName(name))

/**
* Creates new builder.
*/
fun builder(className: ClassName): KotlinAnnotationClassSpecBuilder = KotlinAnnotationClassSpecBuilder(className = className)
}

Expand All @@ -41,14 +47,28 @@ class KotlinAnnotationClassSpecBuilder internal constructor(
private var repeatable: Boolean = false
private var mustBeDocumented: Boolean = false


/**
* Add mustBeDocumented.
*/
fun mustBeDocumented() = apply { this.mustBeDocumented = true }

/**
* Add repeatable.
*/
fun repeatable() = apply { this.repeatable = true }

/**
* Add retention.
*/
fun retention(retention: AnnotationRetention) = apply { this._retention = retention }

/**
* Add target.
*/
fun target(vararg targets: AnnotationTarget) = apply { this.targets.addAll(targets) }

fun addOriginatingElement(originatingElement: Element) = builder { this.addOriginatingElement(originatingElement) }

internal fun addOriginatingElement(originatingElement: Element) = builder { this.addOriginatingElement(originatingElement) }

Check warning on line 71 in kotlin-code-generation/src/main/kotlin/builder/KotlinAnnotationClassSpecBuilder.kt

View check run for this annotation

Codecov / codecov/patch

kotlin-code-generation/src/main/kotlin/builder/KotlinAnnotationClassSpecBuilder.kt#L71

Added line #L71 was not covered by tests

override fun build(): KotlinAnnotationClassSpec {
if (constructorProperties.isNotEmpty()) {
Expand Down

0 comments on commit ada9b8c

Please sign in to comment.