Add ValueProvider.kt
This commit is contained in:
parent
66c708d9fb
commit
da9d6e7639
@ -9,9 +9,15 @@ public fun interface ValueProvider {
|
|||||||
public fun getValue(name: Name): Value?
|
public fun getValue(name: Name): Value?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public fun ValueProvider.getValue(key: String): Value? = getValue(Name.parse(key))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An object that could consume values
|
* An object that could consume values
|
||||||
*/
|
*/
|
||||||
public interface MutableValueProvider : ValueProvider {
|
public interface MutableValueProvider : ValueProvider {
|
||||||
public fun setValue(name: Name, value: Value?)
|
public fun setValue(name: Name, value: Value?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public fun MutableValueProvider.setValue(key: String, value: Value?) {
|
||||||
|
setValue(Name.parse(key), value)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user