@Test public void testFallbackCamelCaseWithEmptyString() { String testInput = ""; String result = underTest.fallback(testInput, true, true, true); assertNull(result); }
public String fallback(String field, boolean replaceUnderscore, boolean replaceUppercaseInWord, boolean capitalizeAll) { String result = null; if (StringUtils.isNotBlank(field)) { if (replaceUppercaseInWord) { result = capitalize(deCamelCase(field), false); } if (replaceUnderscore) { result = capitalize(deUnderScore(result != null ? result : field), capitalizeAll); } } return result; }
LabelFallbackHandler { public String fallback(String field, boolean replaceUnderscore, boolean replaceUppercaseInWord, boolean capitalizeAll) { String result = null; if (StringUtils.isNotBlank(field)) { if (replaceUppercaseInWord) { result = capitalize(deCamelCase(field), false); } if (replaceUnderscore) { result = capitalize(deUnderScore(result != null ? result : field), capitalizeAll); } } return result; } }
LabelFallbackHandler { public String fallback(String field, boolean replaceUnderscore, boolean replaceUppercaseInWord, boolean capitalizeAll) { String result = null; if (StringUtils.isNotBlank(field)) { if (replaceUppercaseInWord) { result = capitalize(deCamelCase(field), false); } if (replaceUnderscore) { result = capitalize(deUnderScore(result != null ? result : field), capitalizeAll); } } return result; } @Inject  LabelFallbackHandler(UIMappingConfig uiMappingConfig); }
LabelFallbackHandler { public String fallback(String field, boolean replaceUnderscore, boolean replaceUppercaseInWord, boolean capitalizeAll) { String result = null; if (StringUtils.isNotBlank(field)) { if (replaceUppercaseInWord) { result = capitalize(deCamelCase(field), false); } if (replaceUnderscore) { result = capitalize(deUnderScore(result != null ? result : field), capitalizeAll); } } return result; } @Inject  LabelFallbackHandler(UIMappingConfig uiMappingConfig); String fallbackIfRequired(String field, String label, boolean replaceUnderscore,
                                   boolean replaceUppercaseInWord, boolean capitalizeAll); String fallbackIfRequired(String field, String label, boolean replaceUnderscore,
                                   boolean replaceUppercaseInWord, boolean capitalizeAll, List<String> prefixesToRemove, List<String> suffixesToRemove); String fallback(String field, boolean replaceUnderscore, boolean replaceUppercaseInWord, boolean capitalizeAll); String fallback(String field, boolean replaceUnderscore, boolean replaceUppercaseInWord, boolean capitalizeAll,
                         List<String> prefixesToRemove,  List<String> suffixesToRemove); boolean isEnabled(); }
LabelFallbackHandler { public String fallback(String field, boolean replaceUnderscore, boolean replaceUppercaseInWord, boolean capitalizeAll) { String result = null; if (StringUtils.isNotBlank(field)) { if (replaceUppercaseInWord) { result = capitalize(deCamelCase(field), false); } if (replaceUnderscore) { result = capitalize(deUnderScore(result != null ? result : field), capitalizeAll); } } return result; } @Inject  LabelFallbackHandler(UIMappingConfig uiMappingConfig); String fallbackIfRequired(String field, String label, boolean replaceUnderscore,
                                   boolean replaceUppercaseInWord, boolean capitalizeAll); String fallbackIfRequired(String field, String label, boolean replaceUnderscore,
                                   boolean replaceUppercaseInWord, boolean capitalizeAll, List<String> prefixesToRemove, List<String> suffixesToRemove); String fallback(String field, boolean replaceUnderscore, boolean replaceUppercaseInWord, boolean capitalizeAll); String fallback(String field, boolean replaceUnderscore, boolean replaceUppercaseInWord, boolean capitalizeAll,
                         List<String> prefixesToRemove,  List<String> suffixesToRemove); boolean isEnabled();  }