All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.model.support.SettingsRepositoryExtensions.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.model.support

import kotlin.reflect.KProperty0
import kotlin.reflect.KProperty1

/**
 * Type safe access to settings.
 */
inline fun  SettingsRepository.getString(property: KProperty1, defaultValue: String): String =
        getString(T::class.java, property.name, defaultValue)

/**
 * Type safe access to settings.
 */
inline fun  SettingsRepository.getPassword(
        property: KProperty1,
        defaultValue: String,
        noinline decryptService: (String?) -> String?
): String = getPassword(T::class.java, property.name, defaultValue, decryptService)

/**
 * Type safe setter of settings
 */
inline fun  SettingsRepository.setString(property: KProperty0) {
    setString(T::class.java, property.name, property.get())
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy