com.xiaoleilu.hutool.convert.impl.BooleanConverter Maven / Gradle / Ivy
package com.xiaoleilu.hutool.convert.impl;
import com.xiaoleilu.hutool.convert.AbstractConverter;
/**
* 波尔转换器
* @author Looly
*
*/
public class BooleanConverter extends AbstractConverter{
@Override
protected Boolean convertInternal(Object value) {
if(boolean.class == value.getClass()){
return Boolean.valueOf((boolean)value);
}
String valueStr = convertToStr(value);
return Boolean.valueOf(PrimitiveConverter.parseBoolean(valueStr));
}
}