net.nemerosa.ontrack.model.extension.ExtensionFeatureOptions.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.extension;
import com.fasterxml.jackson.annotation.JsonProperty
/**
* Options for a feature
*
* @property isGui Does the extension provides some web components?
* @property dependencies List of extensions IDs this feature depends on.
*/
class ExtensionFeatureOptions(
@JsonProperty("gui")
val isGui: Boolean = false,
val dependencies: Set
) {
companion object {
/**
* Default options
*/
@JvmField
val DEFAULT = ExtensionFeatureOptions(
isGui = false,
dependencies = emptySet()
)
}
/**
* With GUI
*/
fun withGui(isGui: Boolean) = ExtensionFeatureOptions(isGui, dependencies)
/**
* List of extensions IDs this feature depends on.
*/
fun withDependencies(dependencies: Set) = ExtensionFeatureOptions(isGui, dependencies)
/**
* Adds a dependency
*/
fun withDependency(feature: ExtensionFeature) = ExtensionFeatureOptions(
isGui,
dependencies + feature.id
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy