java iterator.next_关于Iterator的next()方法,该如何处理

这段代码展示了在Java中如何使用迭代器遍历列表,检查每个对象的特定字段是否为空,如Companycode、Salechannelcode等,并在发现空值时记录错误。还涉及到条件校验,比如当Chargetypecode等于2时,检查BANKCODE、Accountname和Accounts是否为空,以及ChargeType为3时,检查PERIODOFVALIDITY的有效格式。
摘要由CSDN通过智能技术生成

Java codeIterator iterator = list.iterator(); while(iterator.hasNext()){ if(iterator.next().getCompanycode()==null){ error.append("接口表中Companycode的必录项有空,"); } else if(iterator.next().getSalechannelcode()==null){ error.append("接口表中Salechannelcode的必录项有空,"); } if(iterator.next().getBillnumber()==null){ error.append("接口表中Billnumber的必录项有空,"); } if(iterator.next().getBillbooknumber()==null){ error.append("接口表中Billbooknumber的必录项有空,"); } if(iterator.next().getSeragentcode()==null){ error.append("接口表中Seragentcode的必录项有空,"); } if(iterator.next().getPhone()==null){ error.append("接口表中Phone的必录项有空,"); } if(iterator.next().getSersectioncode()==null){ error.append("接口表中Sersectioncode的必录项有空,"); } if(iterator.next().getSerteamcode()==null){ error.append("接口表中Serteamcode的必录项有空,"); } if(iterator.next().getPolicyholdername()==null){ error.append("接口表中Policyholdername的必录项有空,"); } if(iterator.next().getInsurecode()==null){ error.append("接口表中Insurecode的必录项有空,"); } if(iterator.next().getCerttypecode()==null){ error.append("接口表中Certtypecode的必录项有空,"); } if(iterator.next().getChargetypecode()==2&&iterator.next().getBankcode()==null){ error.append("CHARGETYPECODE=2转帐时,BANKCODE不能为空,"); } if(iterator.next().getChargetypecode()==2&&iterator.next().getAccountname()==null){ error.append("CHARGETYPECODE=2转帐时,Accountname不能为空,"); } if(iterator.next().getChargetypecode()==2&&iterator.next().getAccounts()==null){ error.append("CHARGETYPECODE=2转帐时,Accounts不能为空,"); } if(iterator.next().getChargetype()==3&&iterator.next().getPeriodofvalidity()==null){ error.append("ChargeType为信用卡时,PERIODOFVALIDITY, 信用卡缴费不能为空,"); } if(iterator.next().getChargetype()==3&&iterator.next().getPeriodofvalidity().matches("^\\d{4}$")){ error.append("ChargeType为信用卡时,信用卡有效期至 格式不正确,"); } if (iterator.next().getChargetype()==3//? 中信信用卡转帐时,Ensuremodel,计划型号必录 &&iterator.next().getBrushbankcode().equals("017") &&iterator.next().getEnsuremodel()==null){ error.append("中信信用卡转帐时,Ensuremodel,计划型号不能为空"); }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值