~/talk

Data Classes and Parsing Json-A Story About Converting Models to Kotlin

Talkat droidcon Berlin 2018 · 2018-06-25..06-27· [kotlin]
links:none on file
slides:none on file

Kitchen Stories migrates JSON models from Java POJOs to Kotlin data classes with default constructor values and non-nullable fields, reducing null-checks; parsing uses Moshi and prefers Moshi 1.6 codegen over Kotlin-reflect. Build-time adapters generate serializers, tests expose three issues: date parsing, required-field crashes (solved by a tolerant adapter that returns null or empty objects), and a Moshi bug that deserializes nulls into non-nullable lists (worked around by filtering nulls). A GitHub repo contains models, adapters and tests proving the approach.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 2:51JSON parsing challenges
  3. 4:16Kotlin data class benefits
  4. 8:28JSON parsing libraries
  5. 11:41Handling parsing errors
  6. 15:39Summary and key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.