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

dev.forcetower.breaker.json.StringJsonPattern.kt Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
package dev.forcetower.breaker.json

import com.google.gson.JsonDeserializer

object StringJsonPattern {
    @JvmStatic
    val STRING_TECH_DESERIALIZER: JsonDeserializer = JsonDeserializer { json, _, _ ->
        val jsonPrimitive = json.asJsonPrimitive
        return@JsonDeserializer try {
            if (jsonPrimitive.isString) {
                val string = json.asString
                string.trim()
            } else {
                println("Error!!!!!!!!!!!!!!!!!!!")
                null
            }
        } catch (error: Throwable) {
            error.printStackTrace()
            null
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy