All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.casadetasha.kexp.sproute.processor.sproutes.SprouteClass.kt Maven / Gradle / Ivy

Go to download

KAPT processor to manage routing boilerplate for KTOR projects. Use in conjunction with the sproutes library.

There is a newer version: 2.1.2-beta-1
Show newest version
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()
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy