【java】把ArrayList的某一个元素放在最后

// 需要补充的数据项
List<InsureSupplyDTO> waitingInsureSupplys = queryInsureSupplys(offerId);
// 配送地址放在最后
InsureSupplyDTO temp = new InsureSupplyDTO();
for (InsureSupplyDTO insureSupplyDTO : waitingInsureSupplys) {
    if (insureSupplyDTO.getItemCode().equals(DictionaryDTO.VALIDATE_RULE_DELIVERY_MODE)) {
        temp = insureSupplyDTO;
        waitingInsureSupplys.remove(insureSupplyDTO);
    }
}
waitingInsureSupplys.add(temp);

猜你喜欢

转载自blog.csdn.net/shiki_41/article/details/80197660