cn.featherfly.conversion.string.basic.BooleanConvertor Maven / Gradle / Ivy
package cn.featherfly.conversion.string.basic;
import cn.featherfly.common.lang.GenericType;
/**
*
* 布尔转换器
*
*
* @author 钟冀
*/
public class BooleanConvertor extends AbstractBasicConvertor>{
/**
*/
public BooleanConvertor() {
}
/**
* {@inheritDoc}
*/
@Override
public Class getSourceType() {
return boolean.class;
}
/**
* {@inheritDoc}
*/
@Override
protected Boolean doToObject(String value, GenericType genericType) {
return Boolean.parseBoolean(value);
}
/**
* {@inheritDoc}
*/
@Override
protected String doToString(Boolean value, GenericType genericType) {
if (value == null) {
return "";
}
return value + "";
}
}