For serialization, there will not be any problem, and we can have the print-out
We can find that when serializing the map key,
Jackson will call
toString() method by default.
The standard solution is to write the
key serialize/deserialize for
Jackson, what if I do not wanna it as this?!
Then, with the same test case above, we can have the following result:
- We can have new
getter & setteras
private, the third-party developers will not call it with mistakes
- Each time, when do serialization, it will create new
List, which may bring a bit performance issue.