domain.DebugInfo.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kontainer Show documentation
Show all versions of kontainer Show documentation
"Kotlin Depdency Injection Framework"
package de.peekandpoke.ultra.kontainer.domain
import de.peekandpoke.ultra.kontainer.InjectionType
import de.peekandpoke.ultra.kontainer.ServiceProvider
import java.time.Instant
import kotlin.reflect.KClass
import kotlin.reflect.KType
data class DebugInfo(
val services: List,
val config: Map
) {
data class ServiceDebugInfo(
val cls: ClassInfo,
val type: ServiceProvider.Type,
val definition: ServiceDefinitionInfo,
val instances: List,
)
data class ServiceDefinitionInfo(
val creates: ClassInfo,
val injectionType: InjectionType,
val injects: List,
val codeLocation: CodeLocation,
val overwrites: ServiceDefinitionInfo?,
) {
data class CodeLocation(
val location: String,
)
}
data class InstanceDebugInfo(
val createdAt: Instant,
val cls: ClassInfo
)
@Suppress("DataClassPrivateConstructor")
data class ClassInfo private constructor(
val fqn: String
) {
companion object {
fun of(cls: KClass): ClassInfo = ClassInfo(
fqn = cls.java.name
)
fun of(type: KType): ClassInfo? = when (val cls = type.classifier) {
is KClass<*> -> of(cls)
else -> null
}
}
}
@Suppress("DataClassPrivateConstructor")
data class ParamInfo(
val name: String,
val provisionType: ProvisionType,
val classes: List,
) {
enum class ProvisionType {
Direct,
Lazy;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy