com.google.devtools.ksp.common.impl.KSNameImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of symbol-processing Show documentation
Show all versions of symbol-processing Show documentation
Symbol processing for Kotlin
package com.google.devtools.ksp.common.impl
import com.google.devtools.ksp.common.KSObjectCache
import com.google.devtools.ksp.symbol.KSName
class KSNameImpl private constructor(val name: String) : KSName {
companion object : KSObjectCache() {
fun getCached(name: String) = cache.getOrPut(name) { KSNameImpl(name) }
}
override fun asString(): String {
return name
}
override fun getQualifier(): String {
return name.split(".").dropLast(1).joinToString(".")
}
override fun getShortName(): String {
return name.split(".").last()
}
}