@Test public void derivingConfigRootNameTestCase() { String simpleClassName = "RootName"; String actual = deriveConfigRootName(simpleClassName, ConfigPhase.RUN_TIME); assertEquals("quarkus.root-name", actual); simpleClassName = "RootNameConfig"; actual = deriveConfigRootName(simpleClassName, ConfigPhase.BUILD_TIME); assertEquals("quarkus.root-name", actual); simpleClassName = "RootNameConfiguration"; actual = deriveConfigRootName(simpleClassName, ConfigPhase.BUILD_AND_RUN_TIME_FIXED); assertEquals("quarkus.root-name", actual); simpleClassName = "RootNameRunTimeConfig"; actual = deriveConfigRootName(simpleClassName, ConfigPhase.RUN_TIME); assertEquals("quarkus.root-name", actual); simpleClassName = "RootNameRuntimeConfig"; actual = deriveConfigRootName(simpleClassName, ConfigPhase.RUN_TIME); assertEquals("quarkus.root-name", actual); simpleClassName = "RootNameRunTimeConfiguration"; actual = deriveConfigRootName(simpleClassName, ConfigPhase.RUN_TIME); assertEquals("quarkus.root-name", actual); simpleClassName = "RootNameBuildTimeConfig"; actual = deriveConfigRootName(simpleClassName, ConfigPhase.BUILD_AND_RUN_TIME_FIXED); assertEquals("quarkus.root-name", actual); simpleClassName = "RootNameBuildTimeConfiguration"; actual = deriveConfigRootName(simpleClassName, ConfigPhase.BUILD_TIME); assertEquals("quarkus.root-name", actual); }
static String deriveConfigRootName(String simpleClassName, ConfigPhase configPhase) { String simpleNameInLowerCase = simpleClassName.toLowerCase(); int length = simpleNameInLowerCase.length(); if (simpleNameInLowerCase.endsWith(CONFIG.toLowerCase())) { String sanitized = simpleClassName.substring(0, length - CONFIG.length()); return deriveConfigRootName(sanitized, configPhase); } else if (simpleNameInLowerCase.endsWith(CONFIGURATION.toLowerCase())) { String sanitized = simpleClassName.substring(0, length - CONFIGURATION.length()); return deriveConfigRootName(sanitized, configPhase); } else if (simpleNameInLowerCase.endsWith(configPhase.getConfigSuffix().toLowerCase())) { String sanitized = simpleClassName.substring(0, length - configPhase.getConfigSuffix().length()); return deriveConfigRootName(sanitized, configPhase); } return Constants.QUARKUS + Constants.DOT + hyphenate(simpleClassName); }
DocGeneratorUtil { static String deriveConfigRootName(String simpleClassName, ConfigPhase configPhase) { String simpleNameInLowerCase = simpleClassName.toLowerCase(); int length = simpleNameInLowerCase.length(); if (simpleNameInLowerCase.endsWith(CONFIG.toLowerCase())) { String sanitized = simpleClassName.substring(0, length - CONFIG.length()); return deriveConfigRootName(sanitized, configPhase); } else if (simpleNameInLowerCase.endsWith(CONFIGURATION.toLowerCase())) { String sanitized = simpleClassName.substring(0, length - CONFIGURATION.length()); return deriveConfigRootName(sanitized, configPhase); } else if (simpleNameInLowerCase.endsWith(configPhase.getConfigSuffix().toLowerCase())) { String sanitized = simpleClassName.substring(0, length - configPhase.getConfigSuffix().length()); return deriveConfigRootName(sanitized, configPhase); } return Constants.QUARKUS + Constants.DOT + hyphenate(simpleClassName); } }
DocGeneratorUtil { static String deriveConfigRootName(String simpleClassName, ConfigPhase configPhase) { String simpleNameInLowerCase = simpleClassName.toLowerCase(); int length = simpleNameInLowerCase.length(); if (simpleNameInLowerCase.endsWith(CONFIG.toLowerCase())) { String sanitized = simpleClassName.substring(0, length - CONFIG.length()); return deriveConfigRootName(sanitized, configPhase); } else if (simpleNameInLowerCase.endsWith(CONFIGURATION.toLowerCase())) { String sanitized = simpleClassName.substring(0, length - CONFIGURATION.length()); return deriveConfigRootName(sanitized, configPhase); } else if (simpleNameInLowerCase.endsWith(configPhase.getConfigSuffix().toLowerCase())) { String sanitized = simpleClassName.substring(0, length - configPhase.getConfigSuffix().length()); return deriveConfigRootName(sanitized, configPhase); } return Constants.QUARKUS + Constants.DOT + hyphenate(simpleClassName); }  }
DocGeneratorUtil { static String deriveConfigRootName(String simpleClassName, ConfigPhase configPhase) { String simpleNameInLowerCase = simpleClassName.toLowerCase(); int length = simpleNameInLowerCase.length(); if (simpleNameInLowerCase.endsWith(CONFIG.toLowerCase())) { String sanitized = simpleClassName.substring(0, length - CONFIG.length()); return deriveConfigRootName(sanitized, configPhase); } else if (simpleNameInLowerCase.endsWith(CONFIGURATION.toLowerCase())) { String sanitized = simpleClassName.substring(0, length - CONFIGURATION.length()); return deriveConfigRootName(sanitized, configPhase); } else if (simpleNameInLowerCase.endsWith(configPhase.getConfigSuffix().toLowerCase())) { String sanitized = simpleClassName.substring(0, length - configPhase.getConfigSuffix().length()); return deriveConfigRootName(sanitized, configPhase); } return Constants.QUARKUS + Constants.DOT + hyphenate(simpleClassName); }  static String computeExtensionDocFileName(String configRoot); static String computeExtensionGeneralConfigDocFileName(String configRoot); static String computeConfigGroupDocFileName(String configGroupClassName); static String computeConfigRootDocFileName(String configRootClassName, String rootName); static void appendConfigItemsIntoExistingOnes(List<ConfigDocItem> existingConfigItems,
            List<ConfigDocItem> configDocItems); static void sort(List<ConfigDocItem> configDocItems); }
DocGeneratorUtil { static String deriveConfigRootName(String simpleClassName, ConfigPhase configPhase) { String simpleNameInLowerCase = simpleClassName.toLowerCase(); int length = simpleNameInLowerCase.length(); if (simpleNameInLowerCase.endsWith(CONFIG.toLowerCase())) { String sanitized = simpleClassName.substring(0, length - CONFIG.length()); return deriveConfigRootName(sanitized, configPhase); } else if (simpleNameInLowerCase.endsWith(CONFIGURATION.toLowerCase())) { String sanitized = simpleClassName.substring(0, length - CONFIGURATION.length()); return deriveConfigRootName(sanitized, configPhase); } else if (simpleNameInLowerCase.endsWith(configPhase.getConfigSuffix().toLowerCase())) { String sanitized = simpleClassName.substring(0, length - configPhase.getConfigSuffix().length()); return deriveConfigRootName(sanitized, configPhase); } return Constants.QUARKUS + Constants.DOT + hyphenate(simpleClassName); }  static String computeExtensionDocFileName(String configRoot); static String computeExtensionGeneralConfigDocFileName(String configRoot); static String computeConfigGroupDocFileName(String configGroupClassName); static String computeConfigRootDocFileName(String configRootClassName, String rootName); static void appendConfigItemsIntoExistingOnes(List<ConfigDocItem> existingConfigItems,
            List<ConfigDocItem> configDocItems); static void sort(List<ConfigDocItem> configDocItems); static final String LEVEL_HACK_URL; }