class ContentTemplate {

  public static ContentTemplate fromConfiguration(String templateName) {
    checkArgument(!Strings.isNullOrEmpty(templateName), "templateName can not be null");
    checkState(Configuration.isInitialized(), "configuration not initialized");
    ConfigValue<String> titleField =
        Configuration.getString(String.format(CONFIG_TITLE_KEY_FORMAT, templateName), null);
    ConfigValue<List<String>> highQualityFields =
        Configuration.getMultiValue(
            String.format(CONFIG_HIGH_KEY_FORMAT, templateName),
            Collections.emptyList(),
            Configuration.STRING_PARSER);
    ConfigValue<List<String>> mediumQualityFields =
        Configuration.getMultiValue(
            String.format(CONFIG_MEDIUM_KEY_FORMAT, templateName),
            Collections.emptyList(),
            Configuration.STRING_PARSER);
    ConfigValue<List<String>> lowQualityFields =
        Configuration.getMultiValue(
            String.format(CONFIG_LOW_KEY_FORMAT, templateName),
            Collections.emptyList(),
            Configuration.STRING_PARSER);
    ConfigValue<Boolean> includeFieldName =
        Configuration.getBoolean(
            String.format(CONFIG_INCLUDE_FIELDNAME_FORMAT, templateName), true);
    ConfigValue<UnmappedColumnsMode> unmappedColumnMode =
        Configuration.getValue(
            String.format(CONFIG_UNMAPPED_COL_MODE_FORMAT, templateName),
            UnmappedColumnsMode.APPEND,
            UnmappedColumnsMode::valueOf);
    return new Builder()
        .setTitle(titleField.get())
        .setHighContent(highQualityFields.get())
        .setMediumContent(mediumQualityFields.get())
        .setLowContent(lowQualityFields.get())
        .setIncludeFieldName(includeFieldName.get())
        .setUnmappedColumnMode(unmappedColumnMode.get())
        .build();
  }

  private  ContentTemplate(Builder builder);

}