Dictionary Compression for Microservices notes
14 karma · joined April 11, 2026
actually this is well-known: like a PoC that goes to production...
record Person(String name, Age age, Iban iban) {}
// {"name": "SuperMario", "age": null, "iban": null}
Person result = mapper.readValue(json, Person.class);
assertThat(result.age()).isNull(); // passes — value class field, null
assertThat(result.iban()).isNull(); // passes — value class field, null
Jackson bypasses the constructor for null JSON tokens (getNullValue() short-circuits), so the
validation in new Age(...) never runs. Both Age and Iban are value classes; both fields are null.
What do you think? Of course, there are limitations as Person cannot be flattened anymore but I guess Valhalla will ship more JEPs later?I’d love feedback from folks who’ve experimented with Valhalla or have opinions on modelling domain types in Java.
PS is there a plan to include hermetic builds, from local sources / git submodules?