io.gitlab.arturbosch.detekt.test.TestDetektion.kt Maven / Gradle / Ivy
package io.gitlab.arturbosch.detekt.test
import io.gitlab.arturbosch.detekt.api.Detektion
import io.gitlab.arturbosch.detekt.api.Finding
import io.gitlab.arturbosch.detekt.api.Notification
import io.gitlab.arturbosch.detekt.api.ProjectMetric
import org.jetbrains.kotlin.com.intellij.openapi.util.Key
import org.jetbrains.kotlin.com.intellij.util.keyFMap.KeyFMap
open class TestDetektion(vararg findings: Finding) : Detektion {
override val metrics: Collection = listOf()
override val findings: Map> = findings.groupBy { it.id }
override val notifications: List = listOf()
private var userData = KeyFMap.EMPTY_MAP
override fun getData(key: Key): V? = userData.get(key)
override fun addData(key: Key, value: V) {
userData = userData.plus(key, value)
}
fun removeData(key: Key) {
userData = userData.minus(key)
}
override fun add(notification: Notification) = throw UnsupportedOperationException("not implemented")
override fun add(projectMetric: ProjectMetric) = throw UnsupportedOperationException("not implemented")
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy