@Test public void testIsMatchCase() { assertThat(StringCaseUtils.isMatchCase("lower-camel-case", "a0")).isTrue(); assertThat(StringCaseUtils.isMatchCase("upper-camel-case", "A0")).isTrue(); assertThat(StringCaseUtils.isMatchCase("upper-hyphen-case", "A-A")).isTrue(); }
public static boolean isMatchCase(String expectedCase, String string) { switch (expectedCase) { case "upper-camel-case": return isUpperCamelCase(string); case "lower-camel-case": return isLowerCamelCase(string); case "upper-hyphen-case": return isUpperHyphenCase(string); default: throw new IllegalArgumentException("Unrecognized case: " + expectedCase); } }
StringCaseUtils { public static boolean isMatchCase(String expectedCase, String string) { switch (expectedCase) { case "upper-camel-case": return isUpperCamelCase(string); case "lower-camel-case": return isLowerCamelCase(string); case "upper-hyphen-case": return isUpperHyphenCase(string); default: throw new IllegalArgumentException("Unrecognized case: " + expectedCase); } } }
StringCaseUtils { public static boolean isMatchCase(String expectedCase, String string) { switch (expectedCase) { case "upper-camel-case": return isUpperCamelCase(string); case "lower-camel-case": return isLowerCamelCase(string); case "upper-hyphen-case": return isUpperHyphenCase(string); default: throw new IllegalArgumentException("Unrecognized case: " + expectedCase); } } private  StringCaseUtils(); }
StringCaseUtils { public static boolean isMatchCase(String expectedCase, String string) { switch (expectedCase) { case "upper-camel-case": return isUpperCamelCase(string); case "lower-camel-case": return isLowerCamelCase(string); case "upper-hyphen-case": return isUpperHyphenCase(string); default: throw new IllegalArgumentException("Unrecognized case: " + expectedCase); } } private  StringCaseUtils(); static boolean isLowerCamelCase(String string); static boolean isUpperCamelCase(String string); static boolean isUpperHyphenCase(String string); static boolean isMatchCase(String expectedCase, String string); }
StringCaseUtils { public static boolean isMatchCase(String expectedCase, String string) { switch (expectedCase) { case "upper-camel-case": return isUpperCamelCase(string); case "lower-camel-case": return isLowerCamelCase(string); case "upper-hyphen-case": return isUpperHyphenCase(string); default: throw new IllegalArgumentException("Unrecognized case: " + expectedCase); } } private  StringCaseUtils(); static boolean isLowerCamelCase(String string); static boolean isUpperCamelCase(String string); static boolean isUpperHyphenCase(String string); static boolean isMatchCase(String expectedCase, String string);  }