@Test public void shouldCreateLookupMethodNames() { assertEquals("sampleLookupMethod", LookupName.lookupMethod("Sample lookup Method")); assertEquals("sampleLookupMethod", LookupName.lookupMethod("SampleLookup Method")); assertEquals("sampleLookupMethod", LookupName.lookupMethod("sample lookup method")); assertEquals("sample", LookupName.lookupMethod("Sample")); assertEquals("sample", LookupName.lookupMethod("sample")); }
public static String lookupMethod(String lookupName) { if (StringUtils.isBlank(lookupName)) { return lookupName; } String[] words = StringUtils.split(lookupName, ' '); StringBuilder sb = new StringBuilder(StringUtils.uncapitalize(words[0])); for (int i = 1; i < words.length; i++) { sb.append(StringUtils.capitalize(words[i])); } return sb.toString(); }
LookupName { public static String lookupMethod(String lookupName) { if (StringUtils.isBlank(lookupName)) { return lookupName; } String[] words = StringUtils.split(lookupName, ' '); StringBuilder sb = new StringBuilder(StringUtils.uncapitalize(words[0])); for (int i = 1; i < words.length; i++) { sb.append(StringUtils.capitalize(words[i])); } return sb.toString(); } }
LookupName { public static String lookupMethod(String lookupName) { if (StringUtils.isBlank(lookupName)) { return lookupName; } String[] words = StringUtils.split(lookupName, ' '); StringBuilder sb = new StringBuilder(StringUtils.uncapitalize(words[0])); for (int i = 1; i < words.length; i++) { sb.append(StringUtils.capitalize(words[i])); } return sb.toString(); } private  LookupName(); }
LookupName { public static String lookupMethod(String lookupName) { if (StringUtils.isBlank(lookupName)) { return lookupName; } String[] words = StringUtils.split(lookupName, ' '); StringBuilder sb = new StringBuilder(StringUtils.uncapitalize(words[0])); for (int i = 1; i < words.length; i++) { sb.append(StringUtils.capitalize(words[i])); } return sb.toString(); } private  LookupName(); static String lookupMethod(String lookupName); static String lookupCountMethod(String lookupNameOrMethodName); static String buildLookupFieldName(String fieldName, String relatedFieldName); static String getRelatedFieldName(String lookupFieldName); static String getFieldName(String lookupFieldName); }
LookupName { public static String lookupMethod(String lookupName) { if (StringUtils.isBlank(lookupName)) { return lookupName; } String[] words = StringUtils.split(lookupName, ' '); StringBuilder sb = new StringBuilder(StringUtils.uncapitalize(words[0])); for (int i = 1; i < words.length; i++) { sb.append(StringUtils.capitalize(words[i])); } return sb.toString(); } private  LookupName(); static String lookupMethod(String lookupName); static String lookupCountMethod(String lookupNameOrMethodName); static String buildLookupFieldName(String fieldName, String relatedFieldName); static String getRelatedFieldName(String lookupFieldName); static String getFieldName(String lookupFieldName);  }