Code for a section of Java Object Data type mapping

Source: Internet
Author: User

                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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.