mirror of
https://github.com/frosch95/SmartCSV.fx.Converter.git
synced 2026-04-11 13:48:22 +02:00
map.getOrPut() method to avoid the suppress warning annotation
This commit is contained in:
@@ -85,11 +85,9 @@ class Converter(val name: String) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
fun constraint(column : JsonObject, key : String, value: Any?) {
|
fun constraint(column : JsonObject, key : String, value: Any?) {
|
||||||
if (value == null) return
|
if (value == null) return
|
||||||
val constraints = column["constraints"] as JsonObject? ?: JsonObject(HashMap<String, Any>())
|
val constraints = column.getOrPut("constraints") { JsonObject(mutableMapOf()) } as JsonObject
|
||||||
column["constraints"] = constraints
|
|
||||||
constraints[key] = value
|
constraints[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user