@Test public void getCamelCaseSmall() { assertEquals("_", BapiFormatHelper.getCamelCaseSmall(null)); assertEquals("_", BapiFormatHelper.getCamelCaseSmall("")); assertEquals("_x", BapiFormatHelper.getCamelCaseSmall("X")); assertEquals("_xY", BapiFormatHelper.getCamelCaseSmall("X_Y")); assertEquals("_xYZ", BapiFormatHelper.getCamelCaseSmall("X_Y_Z")); assertEquals("_myLittleField", BapiFormatHelper.getCamelCaseSmall("MY_LITTLE_FIELD")); }
public static String getCamelCaseSmall(final String sapName) { StringBuilder result = new StringBuilder("_"); if (sapName == null) { return result.toString(); } String[] parts = sapName.split("_"); for (int i = 0; i < parts.length; i++) { if (i == 0) { result.append(parts[i].toLowerCase()); } else { result.append(parts[i].substring(0, 1).toUpperCase()); result.append(parts[i].substring(1).toLowerCase()); } } return result.toString(); }
BapiFormatHelper { public static String getCamelCaseSmall(final String sapName) { StringBuilder result = new StringBuilder("_"); if (sapName == null) { return result.toString(); } String[] parts = sapName.split("_"); for (int i = 0; i < parts.length; i++) { if (i == 0) { result.append(parts[i].toLowerCase()); } else { result.append(parts[i].substring(0, 1).toUpperCase()); result.append(parts[i].substring(1).toLowerCase()); } } return result.toString(); } }
BapiFormatHelper { public static String getCamelCaseSmall(final String sapName) { StringBuilder result = new StringBuilder("_"); if (sapName == null) { return result.toString(); } String[] parts = sapName.split("_"); for (int i = 0; i < parts.length; i++) { if (i == 0) { result.append(parts[i].toLowerCase()); } else { result.append(parts[i].substring(0, 1).toUpperCase()); result.append(parts[i].substring(1).toLowerCase()); } } return result.toString(); } private  BapiFormatHelper(); }
BapiFormatHelper { public static String getCamelCaseSmall(final String sapName) { StringBuilder result = new StringBuilder("_"); if (sapName == null) { return result.toString(); } String[] parts = sapName.split("_"); for (int i = 0; i < parts.length; i++) { if (i == 0) { result.append(parts[i].toLowerCase()); } else { result.append(parts[i].substring(0, 1).toUpperCase()); result.append(parts[i].substring(1).toLowerCase()); } } return result.toString(); } private  BapiFormatHelper(); static String getCamelCaseSmall(final String sapName); static String getCamelCaseBig(final String sapName); }
BapiFormatHelper { public static String getCamelCaseSmall(final String sapName) { StringBuilder result = new StringBuilder("_"); if (sapName == null) { return result.toString(); } String[] parts = sapName.split("_"); for (int i = 0; i < parts.length; i++) { if (i == 0) { result.append(parts[i].toLowerCase()); } else { result.append(parts[i].substring(0, 1).toUpperCase()); result.append(parts[i].substring(1).toLowerCase()); } } return result.toString(); } private  BapiFormatHelper(); static String getCamelCaseSmall(final String sapName); static String getCamelCaseBig(final String sapName);  }