object ModelConfigurationStore { var modelConfigurations = mutableListOf().observable() fun save(persistencePath: String) { val file = File(persistencePath) val jsn = modelConfigurations.toJSON() jsn.save(file.toPath(), CREATE, TRUNCATE_EXISTING) } fun load(persistencePath: String) { val file = File(persistencePath) modelConfigurations.clear() if (file.exists()) { modelConfigurations.addAll( loadJsonArray(file.toPath(), READ) as Iterable) } } }