Skip to content

Instantly share code, notes, and snippets.

@hissain
Created May 6, 2020 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hissain/46bc42948e16db8821e6bae08af2569b to your computer and use it in GitHub Desktop.
Save hissain/46bc42948e16db8821e6bae08af2569b to your computer and use it in GitHub Desktop.
val gSon = GsonBuilder().registerTypeAdapter(Student::class.java, StudentDeserializer()).create()
val student = gSon.fromJson<Student>(json2, Student::class.java)
/** Output student will be like below **/
student.name // Mark
student.address // { "city": "London", "post": "12000" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment