/** * Get all ReportModels that should be displayed in the path to this report. */ default List<ReportModel> getAllParentsInReversedOrder() { List<ReportModel> reports = new ArrayList<>(); ReportModel currentReport = this; reports.add(this); while (currentReport.getParentReport() != null) { reports.add(currentReport.getParentReport()); currentReport = currentReport.getParentReport(); } Collections.reverse(reports); return reports; } }
/** * Get all ReportModels that should be displayed in the path to this report. */ default List<ReportModel> getAllParentsInReversedOrder() { List<ReportModel> reports = new ArrayList<>(); ReportModel currentReport = this; reports.add(this); while (currentReport.getParentReport() != null) { reports.add(currentReport.getParentReport()); currentReport = currentReport.getParentReport(); } Collections.reverse(reports); return reports; } }