CaseSyntax { public static String normalizeExample(String example) { if (example == null) { return null; } return CaseConversion.LOWER_CASE.convert(removeSpecialCharacters(example)); } private  CaseSyntax(Character separator, CaseConversion allCharCase, String example); private  CaseSyntax(Character separator, CaseConversion firstCharCase, CaseConversion wordStartCharCase, String example); private  CaseSyntax(Character separator, CaseConversion firstCharCase, CaseConversion wordStartCharCase, CaseConversion otherCharCase, String example); private  CaseSyntax(Character separator, CaseConversion firstCharCase, CaseConversion wordStartCharCase, CaseConversion otherCharCase, String example,
      boolean register); Character getWordSeparator(); boolean hasWordSeparator(); CaseConversion getFirstCase(); CaseConversion getWordStartCase(); CaseConversion getOtherCase(); String convert(String string); String convert(String string, Locale locale); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static CaseSyntax of(Character separator, CaseConversion allCharCase); static CaseSyntax of(Character separator, CaseConversion firstCharCase, CaseConversion wordStartCharCase); static CaseSyntax of(Character separator, CaseConversion firstCharCase, CaseConversion wordStartCharCase, CaseConversion otherCharCase); static String normalizeExample(String example); static CaseSyntax ofExample(String example, boolean standardize); static final Character KEEP_SPECIAL_CHARS; static final CaseSyntax LOWERCASE; static final CaseSyntax UPPERCASE; static final CaseSyntax CAML_CASE; static final CaseSyntax PASCAL_CASE; static final CaseSyntax TRAIN_CASE; static final CaseSyntax UPPER_TRAIN_CASE; static final CaseSyntax PASCAL_TRAIN_CASE; static final CaseSyntax CAML_TRAIN_CASE; static final CaseSyntax LOWER_SNAKE_CASE; static final CaseSyntax UPPER_SNAKE_CASE; static final CaseSyntax PASCAL_SNAKE_CASE; static final CaseSyntax CAML_SNAKE_CASE; static final CaseSyntax LOWER_SPACE_CASE; static final CaseSyntax UPPER_SPACE_CASE; static final CaseSyntax PASCAL_SPACE_CASE; static final CaseSyntax CAML_SPACE_CASE; static final CaseSyntax UNMODIFIED; static final CaseSyntax CAPITALIZED; static final CaseSyntax UNCAPITALIZED; static final CaseSyntax CAPITALIZED_LOWER; static final CaseSyntax UNCAPITALIZED_UPPER; }
@Test public void testNormalizeExample() { assertThat(CaseSyntax.normalizeExample(null)).isNull(); assertThat(CaseSyntax.normalizeExample("")).isEmpty(); assertThat(CaseSyntax.normalizeExample(" ")).isEmpty(); assertThat(CaseSyntax.normalizeExample("-")).isEmpty(); assertThat(CaseSyntax.normalizeExample("aBcDeFg")).isEqualTo("abcdefg"); assertThat(CaseSyntax.normalizeExample("A-B-C-D")).isEqualTo("abcd"); }