From 1a447f1954fab3bfbaf09488b56ef7dfa82f0406 Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Tue, 9 Feb 2021 12:30:24 +0700 Subject: [PATCH] Add config and formatter data set to concurrent map --- src/main/kotlin/com/cubetiqs/money/MoneyConfig.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/cubetiqs/money/MoneyConfig.kt b/src/main/kotlin/com/cubetiqs/money/MoneyConfig.kt index 3605666..bf885ec 100644 --- a/src/main/kotlin/com/cubetiqs/money/MoneyConfig.kt +++ b/src/main/kotlin/com/cubetiqs/money/MoneyConfig.kt @@ -1,5 +1,8 @@ package com.cubetiqs.money +import java.util.concurrent.ConcurrentHashMap +import java.util.concurrent.ConcurrentMap + /** * Default money config in static object. * Sample parse format: USD=1,KHR=4000,EUR=0.99 @@ -14,10 +17,10 @@ object MoneyConfig { * Key is the currency * Value is the rate */ - private val config: MutableMap = mutableMapOf() + private val config: ConcurrentMap = ConcurrentHashMap() // use to format the money for each value, if have - private val configFormatter: MutableMap = mutableMapOf() + private val configFormatter: ConcurrentMap = ConcurrentHashMap() // use to identified for config dataset with prefix mode private var configPrefix: String = ""