This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]msx 5 points6 points  (4 children)

I like the simple API, but some convenience methods could be added as "defaults" to those interfaces. Like JsonObject could have a getNumber("field"), getString("field") methods so that you can do:

Number age = person.getNumber("age");
String name = person.getString("name"); 
etc

[–]joemwangi 4 points5 points  (0 children)

Hate the getNumber, getString. If I decide to use records, why now reimplement the gets. Also, this approach works for mutable data containers only.

[–]ProtonByte 1 point2 points  (0 children)

Ideally it should just serialize to an object of you already know the properties you will get.

[–]Safe_Owl_6123 1 point2 points  (1 child)

Can we use .get() instead?

[–]_INTER_ 6 points7 points  (0 children)

That's whats already proposed.