|
|
@@ -16,8 +16,6 @@
|
|
|
|
|
|
package com.jfinal.template.ext.extensionmethod;
|
|
|
|
|
|
-import com.jfinal.template.expr.ast.Logic;
|
|
|
-
|
|
|
/**
|
|
|
* 针对 java.lang.Integer 的扩展方法
|
|
|
*
|
|
|
@@ -47,7 +45,7 @@ import com.jfinal.template.expr.ast.Logic;
|
|
|
public class IntegerExt {
|
|
|
|
|
|
public Boolean toBoolean(Integer self) {
|
|
|
- return Logic.isTrue(self);
|
|
|
+ return self != 0;
|
|
|
}
|
|
|
|
|
|
public Integer toInt(Integer self) {
|
|
|
@@ -55,15 +53,15 @@ public class IntegerExt {
|
|
|
}
|
|
|
|
|
|
public Long toLong(Integer self) {
|
|
|
- return self != null ? self.longValue() : null;
|
|
|
+ return self.longValue();
|
|
|
}
|
|
|
|
|
|
public Float toFloat(Integer self) {
|
|
|
- return self != null ? self.floatValue() : null;
|
|
|
+ return self.floatValue();
|
|
|
}
|
|
|
|
|
|
public Double toDouble(Integer self) {
|
|
|
- return self != null ? self.doubleValue() : null;
|
|
|
+ return self.doubleValue();
|
|
|
}
|
|
|
}
|
|
|
|