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

com.jetbrains.plugin.structure.base.telemetry.PluginTelemetry.kt Maven / Gradle / Ivy

Go to download

Base library for parsing JetBrains plugins. Used by other JetBrains Plugins structure libraries.

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy