private ConfigEntry toConfigEntry(ConfigDef.ConfigKey configKey,
                                      Object value,
                                      ConfigSource source,
                                      Function<String, String> converter) {
        // Convert the value into a nullable string suitable for storing in ConfigEntry.
        String stringValue = null;
        if (value != null) {
            if (value instanceof String) {
                // The value may already be a string if it's coming from a Map<String, String>.
                // Then it doesn't need to be converted.
                stringValue = (String) value;
            } else if (value instanceof Password) {
                // We want the actual value here, not [hidden], which is what we'd get
                // from Password#toString. While we don't return sensitive config values
                // over the wire to users, we may need the real value internally.
                stringValue = ((Password) value).value();
            } else {
                try {
                    // Use the ConfigDef function here which will handle List, Class, etc.
                    stringValue = ConfigDef.convertToString(value, configKey.type);
                } catch (Exception e) {
                    throw new RuntimeException("Unable to convert " + configKey.name + " to string.", e);
                }
            }
        }
        if (stringValue != null) {
            stringValue = converter.apply(stringValue);
        }
        return new ConfigEntry(
            configKey.name,
            stringValue,
            source,
            configKey.type().isSensitive(),
            false, // "readonly" is always false, for now.
            emptyList(), // we don't populate synonyms, for now.
            translateConfigType(configKey.type()),
            configKey.documentation);
    }
Get the default value of the configuration key, or null if no default is specified.
metadata/src/main/java/org/apache/kafka/metadata/KafkaConfigSchema.java