Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望在序列化过程中忽略所有空属性,因此,我setSkipNull(true)在 GensonBuilder 中使用了。
setSkipNull(true)
Genson genson = new GensonBuilder().setSkipNull(true).create();
但是,这似乎仅适用于非集合的属性。在序列化 Collection 类型的属性时,Genson 没有将其排除,而是将其包含为[](空数组)值。
[]
如何排除为空的 Collection 类型的属性?