@Test public void shouldNotTrimRegularClassNames() { assertNull(ClassName.trimTrashHistorySuffix(null)); assertEquals("", ClassName.trimTrashHistorySuffix("")); assertEquals("org.motechproject.domain.Test", ClassName.trimTrashHistorySuffix("org.motechproject.domain.Test")); assertEquals("org.motechproject.domain.history.TestHistory", ClassName.trimTrashHistorySuffix("org.motechproject.domain.history.TestHistory")); assertEquals("org.motechproject.domain.history.TestTrash", ClassName.trimTrashHistorySuffix("org.motechproject.domain.history.TestTrash")); }
public static String trimTrashHistorySuffix(String name) { String trimmedName = name; if (StringUtils.isNotBlank(trimmedName)) { trimmedName = trimmedName.replaceAll("\\.history\\.(.+)__(History|Trash)$", ".$1"); if (trimmedName.startsWith(".")) { trimmedName = trimmedName.substring(1); } } return trimmedName; }
ClassName { public static String trimTrashHistorySuffix(String name) { String trimmedName = name; if (StringUtils.isNotBlank(trimmedName)) { trimmedName = trimmedName.replaceAll("\\.history\\.(.+)__(History|Trash)$", ".$1"); if (trimmedName.startsWith(".")) { trimmedName = trimmedName.substring(1); } } return trimmedName; } }
ClassName { public static String trimTrashHistorySuffix(String name) { String trimmedName = name; if (StringUtils.isNotBlank(trimmedName)) { trimmedName = trimmedName.replaceAll("\\.history\\.(.+)__(History|Trash)$", ".$1"); if (trimmedName.startsWith(".")) { trimmedName = trimmedName.substring(1); } } return trimmedName; } private  ClassName(); }
ClassName { public static String trimTrashHistorySuffix(String name) { String trimmedName = name; if (StringUtils.isNotBlank(trimmedName)) { trimmedName = trimmedName.replaceAll("\\.history\\.(.+)__(History|Trash)$", ".$1"); if (trimmedName.startsWith(".")) { trimmedName = trimmedName.substring(1); } } return trimmedName; } private  ClassName(); static String getSimpleName(String className); static String getPackage(String className); static String getHistoryClassName(String className); static String getTrashClassName(String className); static String getEntityClassName(String simpleName); static String getRepositoryName(String className); static String getInterfaceName(String className); static String getServiceClassName(String className); static String getServiceName(String className); static String trimTrashHistorySuffix(String name); static String getEntityTypeSuffix(String name); static boolean isTrashClassName(String className); static boolean isHistoryClassName(String className); static String restId(String entityName, String module, String namespace); static String restUrl(String entityName, String entityModule, String entityNamespace); static String restLookupUrl(String entityName, String entityModule, String entityNamespace,
                                       String lookupMethodName); static String simplifiedModuleName(String moduleName); static String getEnumPackage(String className); }
ClassName { public static String trimTrashHistorySuffix(String name) { String trimmedName = name; if (StringUtils.isNotBlank(trimmedName)) { trimmedName = trimmedName.replaceAll("\\.history\\.(.+)__(History|Trash)$", ".$1"); if (trimmedName.startsWith(".")) { trimmedName = trimmedName.substring(1); } } return trimmedName; } private  ClassName(); static String getSimpleName(String className); static String getPackage(String className); static String getHistoryClassName(String className); static String getTrashClassName(String className); static String getEntityClassName(String simpleName); static String getRepositoryName(String className); static String getInterfaceName(String className); static String getServiceClassName(String className); static String getServiceName(String className); static String trimTrashHistorySuffix(String name); static String getEntityTypeSuffix(String name); static boolean isTrashClassName(String className); static boolean isHistoryClassName(String className); static String restId(String entityName, String module, String namespace); static String restUrl(String entityName, String entityModule, String entityNamespace); static String restLookupUrl(String entityName, String entityModule, String entityNamespace,
                                       String lookupMethodName); static String simplifiedModuleName(String moduleName); static String getEnumPackage(String className);  }