aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/romangraef/jrconfig/ConfigVariable.kt
blob: c0ade3972b42422ba852de4d46da92dbf42c4168 (plain)
1
2
3
4
5
6
7
8
9
10
11
package com.romangraef.jrconfig

import kotlin.reflect.KProperty

interface ConfigVariable<T> {
    fun get(): T
    fun set(value: T)
    operator fun getValue(thisRef: Any?, property: KProperty<*>) = get()
    operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = set(value)
    fun defaultValue(t: T?): ConfigVariable<T>
}