public static boolean getBoolean(final Map<String, Object> configs, final String key, final boolean defaultValue) {
        final Object value = configs.getOrDefault(key, defaultValue);
        if (value instanceof Boolean) {
            return (boolean) value;
        } else if (value instanceof String) {
            return Boolean.parseBoolean((String) value);
        } else {
            log.error("Invalid value (" + value + ") on configuration '" + key + "'. The default value '" + defaultValue + "' will be used instead. Please specify a true/false value.");
            return defaultValue;
        }
    }
Finds and returns a boolean configuration option from the configuration map or the default value if the option is
not set.

@param configs Map with the configuration options
@param key Configuration option for which the boolean value will be returned
@param defaultValue The default value that will be used when the key is not present
@return A boolean value of the configuration option of the default value
clients/src/main/java/org/apache/kafka/common/utils/ConfigUtils.java