我想使用 List.distinctBy 过滤由(Javaslang)提供的列表我在我的 pom.xml 中添加了这个依赖项
<dependency>
<groupId>io.vavr</groupId>
<artifactId>vavr-kotlin</artifactId>
<version>0.10.0</version>
但是当我在代码中使用它时
menuPriceByDayService
.findAllOrderByUpdateDate(menu, DateUtils.semestralDate(), 26)
.stream()
.distinctBy(MenuPriceByDay::getUpdateLocalDate)
.map(cp -> cp.getUpdateLocalDate())
.sorted()
.forEach(System.out::println);
我有一个编译错误:
The method distinctBy(MenuPriceByDay::getUpdateLocalDate) is undefined for the type
Stream<MenuPriceByDay>