com.jetbrains.plugin.structure.base.telemetry.PluginTelemetry.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of structure-base Show documentation
Show all versions of structure-base Show documentation
Base library for parsing JetBrains plugins. Used by other JetBrains Plugins structure libraries.
package com.jetbrains.plugin.structure.base.telemetry
import com.jetbrains.plugin.structure.base.utils.Bytes
import java.time.Duration
open class PluginTelemetry {
protected val data: MutableMap = mutableMapOf()
internal constructor(from: Map) {
data.putAll(from)
}
constructor(vararg pairs: Pair) {
data.putAll(pairs)
}
open val archiveFileSize: Bytes
get() = data[ARCHIVE_FILE_SIZE] as Bytes
open val parsingDuration: Duration?
get() = data[PARSING_DURATION] as Duration?
operator fun get(key: String): Any? {
return data[key]
}
override fun toString(): String {
return data.toString()
}
fun toMap(): Map {
return data.toMap()
}
}