我有以下界面:
public interface beanExample {
public BigDecimal norm(BigDecimal dec);
}
然后我为它创建一个类别:
public class beanExampleCategory {
public static BigDecimal norm(BigDecimal dec) {
return dec != null ? dec : BigDecimal.ZERO;
}
}
我的工厂看起来像:
@Category(beanExampleCategory.class)
public interface myFactory extends AutoBeanFactory {
AutoBean<beanExample> mybean();
}
但是当我编译时,我得到了这些错误:
[ERROR] The beanExample parameterization is not simple
and the following methods did not have static implementations:
[ERROR] public abstract java.math.BigDecimal norm(java.math.BigDecimal dec)
[ERROR] Unable to complete due to previous errors
我尝试解决几种方法,但我无法弄清楚如何解决它!
如何使用 AutoBean 实现带有参数的方法?