📄 byteconverter.java
字号:
package jodd.bean.converters;/** * Converts given object to Byte. Given object (if not already instance of * Byte) is first converted to String and then analyzed. */public class ByteConverter implements jodd.bean.Converter { public Object convert(Object value) throws IllegalArgumentException { if (value == null) { return (Byte) null; } if (value instanceof Byte) { return (value); } else if (value instanceof Number) { return new Byte(((Number)value).byteValue()); } try { return (new Byte(value.toString())); } catch (Exception e) { throw new IllegalArgumentException("Byte conversion for " + value + " failed."); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -