com.casadetasha.kexp.sproute.processor.sproutes.SprouteClass.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sproutes-processor Show documentation
Show all versions of sproutes-processor Show documentation
KAPT processor to manage routing boilerplate for KTOR projects. Use in conjunction with the sproutes library.
package com.casadetasha.kexp.sproute.processor.sproutes
import com.casadetasha.kexp.annotationparser.KotlinValue
import com.casadetasha.kexp.sproute.processor.sproutes.segments.RouteSegment
import com.squareup.kotlinpoet.MemberName
import com.squareup.kotlinpoet.metadata.KotlinPoetMetadataPreview
import com.squareup.kotlinpoet.metadata.specs.ClassData
@OptIn(KotlinPoetMetadataPreview::class)
internal open class SprouteClass(
private val routeSegment: RouteSegment,
val classData: ClassData,
val primaryConstructorParams: List?,
functions: Set
) : SprouteParent(
packageName = classData.className.packageName,
classSimpleName = classData.className.simpleName
) {
override val sprouteRequestFunctions: Set by lazy {
functions
.map {
SprouteRequestFunction(
sprouteRootKey = routeSegment.segmentKey,
kotlinFunction = it
)
}.toSet()
}
}