private String normalizeWord(String word) { switch (this) { case LOWER_HYPHEN: return Ascii.toLowerCase(word); case LOWER_UNDERSCORE: return Ascii.toLowerCase(word); case LOWER_CAMEL: return firstCharOnlyToUpper(word); case UPPER_CAMEL: return firstCharOnlyToUpper(word); case UPPER_UNDERSCORE: return Ascii.toUpperCase(word); } throw new RuntimeException("unknown case: " + this); }
private String normalizeWord(String word) { switch (this) { case LOWER_HYPHEN: return Ascii.toLowerCase(word); case LOWER_UNDERSCORE: return Ascii.toLowerCase(word); case LOWER_CAMEL: return firstCharOnlyToUpper(word); case UPPER_CAMEL: return firstCharOnlyToUpper(word); case UPPER_UNDERSCORE: return Ascii.toUpperCase(word); } throw new RuntimeException("unknown case: " + this); }