public static <T> boolean getBooleanParamValue(T paramCntr, WebFieldDef fieldDef,
            boolean required, Boolean defValue,
            StringBuilder sBuffer,
            ProcessResult result) {
        if (!getStringParamValue(paramCntr, fieldDef,
                required, null, sBuffer, result)) {
            return result.isSuccess();
        }
        String paramValue = (String) result.getRetData();
        if (paramValue == null) {
            result.setSuccResult(defValue);
            return result.isSuccess();
        }
        if (paramValue.equalsIgnoreCase("true")
                || paramValue.equalsIgnoreCase("false")) {
            result.setSuccResult(Boolean.parseBoolean(paramValue));
        } else {
            try {
                result.setSuccResult(!(Long.parseLong(paramValue) == 0));
            } catch (Throwable e) {
                result.setSuccResult(defValue);
            }
        }
        return result.isSuccess();
    }
Parse the parameter value from an object value to a boolean value

@param paramCntr   parameter container object
@param fieldDef    the parameter field definition
@param required    a boolean value represent whether the parameter is must required
@param defValue    a default value returned if the field not exist
@param sBuffer     string buffer
@param result      process result
@return valid result for the parameter value
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/utils/WebParameterUtils.java