You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.
fun main (args: Array ) {
val obj:JsonObject = jsonObject(
"name" to "kotson",
"files" to 4
)
println(" ${obj}")
class Person(public val obj: JsonObject) {
val name: String by obj.byString("name")
val files: Int by obj.byInt("files")
}
val person=Gson().fromJson(obj,Person ::class.java)
}`
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
for example, this does not work
`import com.github.salomonbrys.kotson.*
import com.google.gson.*
fun main (args: Array ) {
val obj:JsonObject = jsonObject(
"name" to "kotson",
"files" to 4
)
println(" ${obj}")
class Person(public val obj: JsonObject) {
val name: String by obj.byString("name")
val files: Int by obj.byInt("files")
}
val person=Gson().fromJson(obj,Person ::class.java)
}`
The text was updated successfully, but these errors were encountered: