Skip to content

Commit e2fbaa3

Browse files
committed
n'afficher que les elements not null
1 parent 8482216 commit e2fbaa3

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

src/main/java/fr/insee/genesis/domain/model/context/DataProcessingContextModel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public List<ScheduleV2Dto> toScheduleV2Dtos() {
5050
}
5151

5252
return kraftwerkExecutionScheduleV2List.stream()
53+
.filter(schedule -> schedule != null && schedule.getScheduleUuid() != null)
5354
.map(schedule -> ScheduleV2Dto.builder()
5455
.scheduleUuid(schedule.getScheduleUuid())
5556
.collectionInstrumentId(getResolvedCollectionInstrumentId())

src/main/java/fr/insee/genesis/domain/service/context/DataProcessingContextService.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -337,18 +337,7 @@ public List<ScheduleV2Dto> getAllSchedulesV2() {
337337
);
338338

339339
return dataProcessingContextModels.stream()
340-
.flatMap(model -> {
341-
if (model.getKraftwerkExecutionScheduleV2List() == null
342-
|| model.getKraftwerkExecutionScheduleV2List().isEmpty()) {
343-
return Stream.of(
344-
ScheduleV2Dto.builder()
345-
.collectionInstrumentId(model.getResolvedCollectionInstrumentId())
346-
.lastExecution(model.getLastExecution())
347-
.build()
348-
);
349-
}
350-
return model.toScheduleV2Dtos().stream();
351-
})
340+
.flatMap(model -> model.toScheduleV2Dtos().stream())
352341
.toList();
353342
}
354343

0 commit comments

Comments
 (0)