@Test public void testTransforms() { assertEquals("FOO", doTransform("foo", "toUpperCase")); assertEquals("foo", doTransform("FOO", "toLowerCase")); }
static String doTransform(String value, String transform) { switch (transform) { case LOWER_CASE: return value.toLowerCase(Locale.ROOT); case UPPER_CASE: return value.toUpperCase(Locale.ROOT); default: throw new UnsupportedOperationException(String.format("transform '%s' is unsupported", transform)); } }
FilterUtil { static String doTransform(String value, String transform) { switch (transform) { case LOWER_CASE: return value.toLowerCase(Locale.ROOT); case UPPER_CASE: return value.toUpperCase(Locale.ROOT); default: throw new UnsupportedOperationException(String.format("transform '%s' is unsupported", transform)); } } }
FilterUtil { static String doTransform(String value, String transform) { switch (transform) { case LOWER_CASE: return value.toLowerCase(Locale.ROOT); case UPPER_CASE: return value.toUpperCase(Locale.ROOT); default: throw new UnsupportedOperationException(String.format("transform '%s' is unsupported", transform)); } } private  FilterUtil(); }
FilterUtil { static String doTransform(String value, String transform) { switch (transform) { case LOWER_CASE: return value.toLowerCase(Locale.ROOT); case UPPER_CASE: return value.toUpperCase(Locale.ROOT); default: throw new UnsupportedOperationException(String.format("transform '%s' is unsupported", transform)); } } private  FilterUtil(); static void checkTransforms(Map<String, String> transforms); static String replace(String filter, String name, String value, Map<String, String> transforms); static String expandUserFilter(User user, String filter); static String expandUserFilter(User user, String filter, Map<String, String> transforms); }
FilterUtil { static String doTransform(String value, String transform) { switch (transform) { case LOWER_CASE: return value.toLowerCase(Locale.ROOT); case UPPER_CASE: return value.toUpperCase(Locale.ROOT); default: throw new UnsupportedOperationException(String.format("transform '%s' is unsupported", transform)); } } private  FilterUtil(); static void checkTransforms(Map<String, String> transforms); static String replace(String filter, String name, String value, Map<String, String> transforms); static String expandUserFilter(User user, String filter); static String expandUserFilter(User user, String filter, Map<String, String> transforms);  }