繁体   English   中英

为 LazyList Apache commons 找到的装饰方法

[英]Decorate method on found for LazyList Apache commons

我在 pom.xml 中为我的 spring 引导项目导入了 apache 公用库。

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>

已在 package 以及 model 文件中导入。

import org.apache.commons.collections4.FactoryUtils;

这是我尝试使用 Apache io 中的 LazyList 的代码。

private List<Children> childrens = LazyList.decorate(new ArrayList<Children>(),FactoryUtils.instantiateFactory(Children.class));

我已经从 Apache commons 导入了 LazyList,但是 STS 无法识别来自 LazyList 的 decorate()。

请找出以下错误。

The method decorate(ArrayList<Children>, FactoryUtils.instantiateFactory(Children.class)) is undefined for the type LazyList

需要快速帮助有人可以帮助我吗?

显然 API 在版本 3 和版本 4 之间发生了显着变化。在 v4 中,您想使用该方法

static <E> LazyList<E>  lazyList(List<E> list, Factory<? extends E> factory)

反而。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM