一个对象判断里面的子对象或者子对象属性为空问题,一般情况下我们会使用多级if去判断。
Optional.ofNullable(draftBudgetDto.getSingleReconciliationReportDto()).map(SingleReconciliationReportDto::getSingleCheckupAgingReportDto).ifPresent(scaDto -> { scaDto.setId(null); });
一个对象判断里面的子对象或者子对象属性为空问题,一般情况下我们会使用多级if去判断。
Optional.ofNullable(draftBudgetDto.getSingleReconciliationReportDto()).map(SingleReconciliationReportDto::getSingleCheckupAgingReportDto).ifPresent(scaDto -> { scaDto.setId(null); });