private static <T> ConfigOption<T> prefixOption(ConfigOption<T> option, String prefix) { String key = prefix + option.key(); List<FallbackKey> deprecatedKeys; if (option.hasFallbackKeys()) { deprecatedKeys = new ArrayList<>(); for (FallbackKey dk : option.fallbackKeys()) { deprecatedKeys.add(createDeprecatedKey(prefix + dk.getKey())); } } else { deprecatedKeys = Collections.emptyList(); } FallbackKey[] deprecated = deprecatedKeys.toArray(new FallbackKey[0]); return new ConfigOption<>(key, option.description(), option.defaultValue(), deprecated); } }
/** * Transforms option to table row. * * @param optionWithMetaInfo option to transform * @return row with the option description */ private static String toHtmlString(final OptionWithMetaInfo optionWithMetaInfo) { ConfigOption<?> option = optionWithMetaInfo.option; String defaultValue = stringifyDefault(optionWithMetaInfo); return "" + " <tr>\n" + " <td><h5>" + escapeCharacters(option.key()) + "</h5></td>\n" + " <td style=\"word-wrap: break-word;\">" + escapeCharacters(addWordBreakOpportunities(defaultValue)) + "</td>\n" + " <td>" + formatter.format(option.description()) + "</td>\n" + " </tr>\n"; }
private static <T> ConfigOption<T> prefixOption(ConfigOption<T> option, String prefix) { String key = prefix + option.key(); List<String> deprecatedKeys; if (option.hasDeprecatedKeys()) { deprecatedKeys = new ArrayList<>(); for (String dk : option.deprecatedKeys()) { deprecatedKeys.add(prefix + dk); } } else { deprecatedKeys = Collections.emptyList(); } String[] deprecated = deprecatedKeys.toArray(new String[deprecatedKeys.size()]); return new ConfigOption<>(key, option.description(), option.defaultValue(), deprecated); } }
private static <T> ConfigOption<T> prefixOption(ConfigOption<T> option, String prefix) { String key = prefix + option.key(); List<String> deprecatedKeys; if (option.hasDeprecatedKeys()) { deprecatedKeys = new ArrayList<>(); for (String dk : option.deprecatedKeys()) { deprecatedKeys.add(prefix + dk); } } else { deprecatedKeys = Collections.emptyList(); } String[] deprecated = deprecatedKeys.toArray(new String[deprecatedKeys.size()]); return new ConfigOption<>(key, option.description(), option.defaultValue(), deprecated); } }