net.nemerosa.ontrack.model.structure.User.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-model Show documentation
Show all versions of ontrack-model Show documentation
Ontrack module: ontrack-model
package net.nemerosa.ontrack.model.structure
import com.fasterxml.jackson.annotation.JsonIgnore
/**
* Representation of a user in Ontrack. Mostly used for traceability and storage.
*/
data class User(
val name: String
) {
@get:JsonIgnore
val isAnonymous: Boolean = ANONYMOUS == name
companion object {
/**
* Name for an anonymous user
*/
const val ANONYMOUS = "anonymous"
/**
* Unique instance of the anonymous user
*/
private val ANONYMOUS_USER = User(ANONYMOUS)
/**
* Anonymous user
*/
fun anonymous(): User = ANONYMOUS_USER
/**
* Builder for a user
*/
fun of(name: String): User = User(name)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy