org.jetbrains.kotlinx.jupyter.api.libraries.LibraryReference.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-jupyter-api Show documentation
Show all versions of kotlin-jupyter-api Show documentation
API for libraries supporting Kotlin Jupyter notebooks
package org.jetbrains.kotlinx.jupyter.api.libraries
data class LibraryReference(
val info: LibraryResolutionInfo,
val name: String? = null,
) : LibraryCacheable by info {
val key: String
init {
val namePart = if (name.isNullOrEmpty()) "" else "${name}_"
key = namePart + info.key
}
override fun toString(): String {
val namePart = name ?: ""
val infoPart = info.toString()
return if (infoPart.isEmpty()) {
namePart
} else {
"$namePart@$infoPart"
}
}
}