Overload plot() function to support more complex configuration

This commit is contained in:
2020-03-21 18:38:25 +01:00
parent a53c4c7042
commit 0e255b6930
6 changed files with 120 additions and 0 deletions

View File

@@ -17,4 +17,10 @@ class ConfigMap(private val map: Map<Value, Value>) {
fun containsKey(key: String): Boolean {
return raw.containsKey(key)
}
fun <T> ifPresent(key: String, consumer: (T) -> Unit) {
if(containsKey(key)) {
consumer(get(key).unwrap() as T)
}
}
}