java - Is there a way to modify a POJO field and return the POJO -
is there way modify field of pojo new property(like using mixins or @jsonproperty
) , modified pojo ? (a way add/modify field of pojo dynamically ?)
like have class
class pojoa<t>{ private t data;//field modified newdata }
so, tried mixins like
public interface pojomixin<t> { @jsonproperty("newdata") t getdata(); }
now modified field, use objectmapper
mapper.addmixinannotations(pojoa.class,pojomixin.class); mapper.writerwithdefaultprettyprinter().writevalueasstring(pojoa);
the actual result string
, can able modified pojo?
Comments
Post a Comment