@Test public void fieldNameToPathTest() throws Exception { assertEquals("camel-casing", StringUtils.fieldNameToPath("CamelCasing")); assertEquals("camel.casing", StringUtils.fieldNameToPath("Camel_Casing")); }
public static String fieldNameToPath(String fieldName) { final StringBuilder path = new StringBuilder(); boolean lastUpper = true; for (char c : fieldName.toCharArray()) { if (c == '_') { lastUpper = true; path.append('.'); continue; } if (Character.isUpperCase(c)) { c = Character.toLowerCase(c); if (!lastUpper) { lastUpper = true; path.append('-'); } } else { lastUpper = false; } path.append(c); } return path.toString(); }
StringUtils { public static String fieldNameToPath(String fieldName) { final StringBuilder path = new StringBuilder(); boolean lastUpper = true; for (char c : fieldName.toCharArray()) { if (c == '_') { lastUpper = true; path.append('.'); continue; } if (Character.isUpperCase(c)) { c = Character.toLowerCase(c); if (!lastUpper) { lastUpper = true; path.append('-'); } } else { lastUpper = false; } path.append(c); } return path.toString(); } }
StringUtils { public static String fieldNameToPath(String fieldName) { final StringBuilder path = new StringBuilder(); boolean lastUpper = true; for (char c : fieldName.toCharArray()) { if (c == '_') { lastUpper = true; path.append('.'); continue; } if (Character.isUpperCase(c)) { c = Character.toLowerCase(c); if (!lastUpper) { lastUpper = true; path.append('-'); } } else { lastUpper = false; } path.append(c); } return path.toString(); } private  StringUtils(); }
StringUtils { public static String fieldNameToPath(String fieldName) { final StringBuilder path = new StringBuilder(); boolean lastUpper = true; for (char c : fieldName.toCharArray()) { if (c == '_') { lastUpper = true; path.append('.'); continue; } if (Character.isUpperCase(c)) { c = Character.toLowerCase(c); if (!lastUpper) { lastUpper = true; path.append('-'); } } else { lastUpper = false; } path.append(c); } return path.toString(); } private  StringUtils(); static String implode(String delimiter, String[] strings); static String fieldNameToPath(String fieldName); static boolean isEmpty(String string); }
StringUtils { public static String fieldNameToPath(String fieldName) { final StringBuilder path = new StringBuilder(); boolean lastUpper = true; for (char c : fieldName.toCharArray()) { if (c == '_') { lastUpper = true; path.append('.'); continue; } if (Character.isUpperCase(c)) { c = Character.toLowerCase(c); if (!lastUpper) { lastUpper = true; path.append('-'); } } else { lastUpper = false; } path.append(c); } return path.toString(); } private  StringUtils(); static String implode(String delimiter, String[] strings); static String fieldNameToPath(String fieldName); static boolean isEmpty(String string);  }