Try{List<GateMetaPO> Listgateinfopo =Majorgatereaderservice.queryforaggregateby (chapter); List<GateInfoPB> list = Lists.transform (Listgateinfopo,NewFunction<gatemetapo, gateinfopb>() {@Override PublicGATEINFOPB Apply (Gatemetapo input) {Gateinfopb.builder Builder=Gateinfopb.newbuilder (); Builder.setchapter (Input.getchapter ()); Builder.setgatecode (Input.getgatecode ()); Builder.setexp (Input.getexp ()); Builder.setmoney (Input.getmoney ()); Builder.setindex (Input.getindex ()); List<EmemyList> ememylist =input.getememylist (); List<EmemyListPB> EMEMYLISTPB = Lists.transform (Ememylist,NewFunction<ememylist, ememylistpb>() {@Override PublicEMEMYLISTPB Apply (ememylist input) {Ememylistpb.builder Builder=Ememylistpb.newbuilder (); Builder.setmode (Input.getmode ()); List<EmemyInfo> Ememyinfo =Input.getememyinfo (); List<EmemyInfoPB> EMEMYINFOPB = Lists.transform (Ememyinfo,NewFunction<ememyinfo, ememyinfopb>() {@Override PublicEMEMYINFOPB Apply (Ememyinfo input) {Ememyinfopb.builder Builder=Ememyinfopb.newbuilder (); Builder.setememycode (Input.getememycode ()); Builder.setindex (Integer.parseint (Input.getememyindex ())); returnBuilder.build (); } }); BUILDER.ADDALLEMEMYINFOPB (EMEMYINFOPB); returnBuilder.build (); } }); BUILDER.ADDALLEMEMYLISTPB (EMEMYLISTPB); List<GoodsList> goodslist =input.getgoodslist (); List<GoodsListPB> GOODSLISTPB = Lists.transform (Goodslist,NewFunction<goodslist, goodslistpb>() {@Override PublicGOODSLISTPB Apply (goodslist input) {//TODO auto-generated Method StubGoodslistpb.builder Builder =Goodslistpb.newbuilder (); Builder.setmode (Input.getmode ()); List<GoodsInfo> Goodsinfo =Input.getgoodsinfo (); List<GoodsInfoPB> GOODSINFOPB = Lists.transform (Goodsinfo,NewFunction<goodsinfo, goodsinfopb>() {@Override PublicGOODSINFOPB Apply (Goodsinfo input) {Goodsinfopb.builder Builder=Goodsinfopb.newbuilder (); Builder.setgoodscode (Input.getgoodscode ()); Builder.setmaxcounts (Input.getmaxcounts ()); Builder.setdroprate (Input.getdroprate ()); returnBuilder.build (); } }); BUILDER.ADDALLGOODSINFOPB (GOODSINFOPB); returnBuilder.build (); } }); BUILDER.ADDALLGOODSLISTPB (GOODSLISTPB); List<GateState> gatestate =input.getgatestatelist (); List<GateStatePB> GATESTATEPB = Lists.transform (Gatestate,NewFunction<gatestate, gatestatepb>() {@Override PublicGATESTATEPB Apply (gatestate input) {Gatestatepb.builder Builder=Gatestatepb.newbuilder (); Builder.setmode (Input.getmode ()); Builder.setbattlestate (Input.getbattlestate ()); Builder.setscore (Input.getscore ()); Builder.setcounts (Input.getcounts ()); Builder.settotal (Input.gettotal ()); returnBuilder.build (); } }); BUILDER.ADDALLGATESTATEPB (GATESTATEPB); returnBuilder.build (); } }); Builder.setresultcode (1). Addallgateinfo (list); } Catch(Exception e) {}
Code for a section of Java Object Data type mapping