net.nemerosa.ontrack.job.JobCategory.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
data class JobCategory(
val key: String,
val name: String
) {
fun withName(name: String) = JobCategory(key, name)
fun getType(key: String): JobType {
return JobType.of(this, key)
}
override fun toString(): String {
return String.format(
"[%s]",
key
)
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is JobCategory) return false
if (key != other.key) return false
return true
}
override fun hashCode(): Int {
return key.hashCode()
}
companion object {
/**
* Core category, used internally
*/
@JvmField
val CORE = JobCategory.of("core").withName("Core")
@JvmStatic
fun of(key: String): JobCategory {
return JobCategory(key, key)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy