我正在尝试使用Jackson来序列化ImmutableMap。定制序列化程序是专门为虚拟类编写的。其余的默认行为都是可以的。它适用于虚拟类,但不适用于ImmutableMap对象。序列化程序类: public class DummySerializer extends StdSerializer<Dummy> {
private final ObjectMapper mappermapper.writeValue(writer, dummyObj.g
在序列化HashMap时,我可以保留类型信息,以便可以将其反序列化为相应的类型,但在序列化com.google.common.collect.ImmutableMap时,这不起作用。// preserve type info
ImmutableMap<String, String> immutableMap
我在一个Android项目中使用番石榴集合。刚刚注意到以下行为:Intent i = new Intent(this, Activity2.class);startActivity(i);Activity2::onCreate(...) {
ImmutableMap<String,String> ma