Commit a5e164b4 authored by yanzg's avatar yanzg

修改实体位置

parent 5d857103
......@@ -76,7 +76,7 @@ public class ObjectHelper {
* @return 返回值
*/
public static int getInt(Object target, String field) {
return get(Integer.class, target, field, 0);
return StringHelper.toInt(get(target, field));
}
/**
......@@ -98,7 +98,7 @@ public class ObjectHelper {
* @return 返回值
*/
public static double getDecimal(Object target, String field) {
return get(Double.class, target, field, 0d);
return StringHelper.toDouble(get(target, field));
}
/**
......@@ -124,7 +124,8 @@ public class ObjectHelper {
public static <T> T get(Class<T> cls, Object target, String field, T def) {
Object val = get(target, field);
T to = StringHelper.to(cls, val);
return to == null ? def : to;
to = to == null ? def : to;
return to;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment