link.jfire.mvc.binder.impl.DoubleBinder Maven / Gradle / Ivy
package link.jfire.mvc.binder.impl;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import link.jfire.baseutil.StringUtil;
import link.jfire.baseutil.verify.Verify;
import link.jfire.mvc.binder.AbstractDataBinder;
public class DoubleBinder extends AbstractDataBinder
{
public DoubleBinder(String paramName)
{
super(paramName);
}
@Override
public Object binder(HttpServletRequest request, Map map, HttpServletResponse response)
{
String value = map.get(paramName);
Verify.True(StringUtil.isNotBlank(value), "参数为double基本类型,页面必须要有传参,请检查传参名字是否是{}", paramName);
return Double.valueOf(value);
}
}