net.nemerosa.ontrack.job.JobKey.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-job Show documentation
Show all versions of ontrack-job Show documentation
Abstract management of identified jobs.
package net.nemerosa.ontrack.job
import io.micrometer.core.instrument.Tag
data class JobKey(
val type: JobType,
val id: String
) {
fun sameType(type: JobType): Boolean {
return this.type == type
}
fun sameCategory(category: JobCategory): Boolean {
return this.type.category == category
}
override fun toString(): String {
return "$type[$id]"
}
val metricTags: List
get() = listOf(
Tag.of("job-type", type.key),
Tag.of("job-category", type.category.key)
)
companion object {
@JvmStatic
fun of(type: JobType, id: String): JobKey {
return JobKey(type, id)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy