All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.metadude.kotlin.library.engelsystem.adapters.ZoneOffsetAdapter.kt Maven / Gradle / Ivy

There is a newer version: 9.2.0
Show newest version
package info.metadude.kotlin.library.engelsystem.adapters

import com.squareup.moshi.FromJson
import org.threeten.bp.DateTimeException
import org.threeten.bp.ZoneOffset

class ZoneOffsetAdapter {

    @FromJson
    fun fromJson(jsonValue: String?) = jsonValue?.let {
        try {
            ZoneOffset.of(jsonValue)
        } catch (e: DateTimeException) {
            println(e.message)
            null
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy