dk.nodes.nstack.kotlin.util.LocaleDeserializer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nstack-kotlin-core Show documentation
Show all versions of nstack-kotlin-core Show documentation
nstack.io library for translations, update management and more.
package dk.nodes.nstack.kotlin.util
import com.google.gson.JsonDeserializationContext
import com.google.gson.JsonDeserializer
import com.google.gson.JsonElement
import java.lang.reflect.Type
import java.util.Locale
internal class LocaleDeserializer : JsonDeserializer {
override fun deserialize(
json: JsonElement?,
typeOfT: Type?,
context: JsonDeserializationContext?
): Locale {
return Locale(json?.asString)
}
}