Skip to content
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.

Simple samples of using Kotson are necessary #41

Open
kubanychlocal opened this issue Sep 16, 2018 · 0 comments
Open

Simple samples of using Kotson are necessary #41

kubanychlocal opened this issue Sep 16, 2018 · 0 comments

Comments

@kubanychlocal
Copy link

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)
}`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant