From 134cb687c4e05fd81a03b682505f9fb9d741a8d7 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 9 May 2020 23:53:57 +0200 Subject: Add new className parameter to all DSL builder functions. --- src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main/kotlin/pl/treksoft/kvision/utils') diff --git a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt index 5f245fb6..e2833630 100644 --- a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt +++ b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt @@ -200,3 +200,11 @@ fun MutableList.syncWithList(list: List) { } } } + +/** + * Utility extension property to generate a set of strings to simplify the notation when using classes parameter. + */ +val String?.set: Set + get() { + return this?.split(Regex("\\s+"))?.toSet() ?: setOf() + } -- cgit