org.nutz.lang.tmpl.TmplLongEle Maven / Gradle / Ivy
package org.nutz.lang.tmpl;
import org.nutz.castor.Castors;
import org.nutz.lang.Strings;
class TmplLongEle extends TmplDynamicEle {
public TmplLongEle(String key, String fmt, String dft) {
super("long", key, fmt, dft);
this.fmt = Strings.sNull(fmt, "%d");
}
@Override
protected String _val(Object val) {
Long n = Castors.me().castTo(val, Long.class);
if (null != n) {
return String.format(fmt, n);
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy