I\'ve a Java class with lot of integer fields and when I want to serialize them to json string due to some of them could have no value, hence after serializing all integers
We have to just use class Integer (Integer javadoc).
Integer
class Example { String title = "something"; Integer id = 22; Integer userId; }