com.seeq.utilities.configuration.DefaultConfigurationWriter.kt Maven / Gradle / Ivy
The newest version!
package com.seeq.utilities.configuration
class DefaultConfigurationWriter(private val configuration: Configuration) : ConfigurationWriter {
override fun write(configurationOptions: Collection>) =
configurationOptions
.map { ConfigurationOptionWrite(it.option.path, it.value, it.note) }
.let { ConfigurationOptionsWrite(it) }
.let { this.write(it, false) }
override fun write(configurationOptions: ConfigurationOptionsWrite, dryRun: Boolean) =
writeConfigurationOptions(configurationOptions, dryRun)
.also {
if (!dryRun && it.isSuccess) {
updateFromReadResult(it.newConfiguration!!, configuration as SettableConfiguration)
}
}
}