Pra*_*eep 9 java apache-commons-collection apache-commons-beanutils
将公共集合从3.2.2升级到4.1后,我遇到了比较BeanPredicate和EqualsPredicate集合的问题.BeanPredicate来自commons-beanutils jar,而EqualsPredicate来自commons-collection.jar.
BeanPredicate namePredicate = new BeanPredicate(propertyName, new EqualPredicate("someString"));
Run Code Online (Sandbox Code Playgroud)
根据最新的commons-collection jar 4.1,EqualsPredicate Constructor接受参数化类型
public EqualPredicate(T object)
{
this(object, null);
}
Run Code Online (Sandbox Code Playgroud)
不是3.2.2中的对象
public EqualPredicate(Object object)
{
this.iValue = object;
}
Run Code Online (Sandbox Code Playgroud)
BeanPredicate没有参数化类型,就像<T>它的构造函数那样,为什么我得到编译问题而且无法在这两个谓词之间建立关系.我看到最新的commons-beanUtils 1.9.3 BeanPredicate jar也有BeanPredicate构造函数没有参数化.我尝试给类型,但它不工作.如何解决这个问题任何帮助将不胜感激.