检查流中的实例
2022-08-31 09:57:36
我有以下表达式:
scheduleIntervalContainers.stream()
.filter(sic -> ((ScheduleIntervalContainer) sic).getStartTime() != ((ScheduleIntervalContainer)sic).getEndTime())
.collect(Collectors.toList());
...其中具有元素类型:scheduleIntervalContainers
ScheduleContainer
final List<ScheduleContainer> scheduleIntervalContainers
是否可以在过滤器之前检查类型?