
cloud.agileframework.common.util.other.BooleanUtil Maven / Gradle / Ivy
package cloud.agileframework.common.util.other;
import org.apache.commons.lang3.ObjectUtils;
/**
* @author mydeathtrial on 2017/4/19
*/
public class BooleanUtil {
public static boolean toBoolean(String resource) {
return "yes".equalsIgnoreCase(resource) || "true".equalsIgnoreCase(resource) || "1".equals(resource);
}
public static boolean toBoolean(Object resource) {
return !ObjectUtils.isEmpty(resource) && Boolean.parseBoolean(resource.toString());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy