mirror of
https://github.com/frosch95/SmartCSV.fx.Converter.git
synced 2026-04-11 05:38: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?) {
|
||||
if (value == null) return
|
||||
val constraints = column["constraints"] as JsonObject? ?: JsonObject(HashMap<String, Any>())
|
||||
column["constraints"] = constraints
|
||||
val constraints = column.getOrPut("constraints") { JsonObject(mutableMapOf()) } as JsonObject
|
||||
constraints[key] = value
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user