net.nemerosa.ontrack.model.form._Form.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.form
import net.nemerosa.ontrack.model.structure.NameDescription
/**
* Creates a [Selection] field from a list of enums.
*
* @param E Type of enum
* @param name Name for this field
* @return Field
*/
inline fun > selection(name: String, displayName: (E) -> String): Selection =
Selection.of(name)
.items(
enumValues().map {
NameDescription.nd(
it.name,
displayName(it)
)
}
)
.itemId("name")
.itemName("description")
© 2015 - 2025 Weber Informatics LLC | Privacy Policy