Converting a Protocol Buffer to a POJO -
is there tool or library can map protobuff object pojo. have pojo implement other interfaces can not protobuff object. or have manually conversion?
maybe late, can try protobuf-converter library. easy use.
convert pojo object related protobuf message:
pojoclass pojoinstance = new pojoclass(); ... protobufclass protoinstance = converter.create().toprotobuf(protobufclass.class, pojoinstance );
code backward conversion:
pojoclass pojoinstance = converter.create().todomain(pojoclass.class, protoinstance);
Comments
Post a Comment