@Test public void testSeparateByUnderscore() { assertNull(StringSimpleFieldActions.separateByUnderscore(new SeparateByUnderscore(), null)); assertEquals("", StringSimpleFieldActions.separateByUnderscore(new SeparateByUnderscore(), "")); assertEquals("_", StringSimpleFieldActions.separateByUnderscore(new SeparateByUnderscore(), "-")); assertEquals("foo", StringSimpleFieldActions.separateByUnderscore(new SeparateByUnderscore(), "foo")); assertEquals("foo_bar", StringSimpleFieldActions.separateByUnderscore(new SeparateByUnderscore(), "foo bar")); assertEquals("foo_bar", StringSimpleFieldActions.separateByUnderscore(new SeparateByUnderscore(), "foo+bar")); assertEquals("foo_bar", StringSimpleFieldActions.separateByUnderscore(new SeparateByUnderscore(), "foo=bar")); assertEquals("foo_bar", StringSimpleFieldActions.separateByUnderscore(new SeparateByUnderscore(), "foo:bar")); assertEquals("f_o_o_b_a_r", StringSimpleFieldActions.separateByUnderscore(new SeparateByUnderscore(), "f:o:o:b:a:r")); }
@AtlasActionProcessor public static String separateByUnderscore(SeparateByUnderscore action, String input) { if (input == null || input.length() == 0) { return input; } return STRING_SEPARATOR_PATTERN.matcher(input).replaceAll("_"); }
StringSimpleFieldActions implements AtlasFieldAction { @AtlasActionProcessor public static String separateByUnderscore(SeparateByUnderscore action, String input) { if (input == null || input.length() == 0) { return input; } return STRING_SEPARATOR_PATTERN.matcher(input).replaceAll("_"); } }
StringSimpleFieldActions implements AtlasFieldAction { @AtlasActionProcessor public static String separateByUnderscore(SeparateByUnderscore action, String input) { if (input == null || input.length() == 0) { return input; } return STRING_SEPARATOR_PATTERN.matcher(input).replaceAll("_"); }  }
StringSimpleFieldActions implements AtlasFieldAction { @AtlasActionProcessor public static String separateByUnderscore(SeparateByUnderscore action, String input) { if (input == null || input.length() == 0) { return input; } return STRING_SEPARATOR_PATTERN.matcher(input).replaceAll("_"); }  @AtlasActionProcessor static String capitalize(Capitalize action, String input); @AtlasActionProcessor static String fileExtension(FileExtension action, String input); @AtlasActionProcessor static String lowercase(Lowercase action, String input); @AtlasActionProcessor static Character lowercaseChar(LowercaseChar action, Character input); @AtlasActionProcessor static String normalize(Normalize action, String input); @AtlasActionProcessor static String removeFileExtension(RemoveFileExtension action, String input); @AtlasActionProcessor static String separateByDash(SeparateByDash action, String input); @AtlasActionProcessor static String separateByUnderscore(SeparateByUnderscore action, String input); @AtlasActionProcessor static String trim(Trim action, String input); @AtlasActionProcessor static String trimLeft(TrimLeft action, String input); @AtlasActionProcessor static String trimRight(TrimRight action, String input); @AtlasActionProcessor static String uppercase(Uppercase action, String input); @AtlasActionProcessor static Character uppercaseChar(UppercaseChar action, Character input); }
StringSimpleFieldActions implements AtlasFieldAction { @AtlasActionProcessor public static String separateByUnderscore(SeparateByUnderscore action, String input) { if (input == null || input.length() == 0) { return input; } return STRING_SEPARATOR_PATTERN.matcher(input).replaceAll("_"); }  @AtlasActionProcessor static String capitalize(Capitalize action, String input); @AtlasActionProcessor static String fileExtension(FileExtension action, String input); @AtlasActionProcessor static String lowercase(Lowercase action, String input); @AtlasActionProcessor static Character lowercaseChar(LowercaseChar action, Character input); @AtlasActionProcessor static String normalize(Normalize action, String input); @AtlasActionProcessor static String removeFileExtension(RemoveFileExtension action, String input); @AtlasActionProcessor static String separateByDash(SeparateByDash action, String input); @AtlasActionProcessor static String separateByUnderscore(SeparateByUnderscore action, String input); @AtlasActionProcessor static String trim(Trim action, String input); @AtlasActionProcessor static String trimLeft(TrimLeft action, String input); @AtlasActionProcessor static String trimRight(TrimRight action, String input); @AtlasActionProcessor static String uppercase(Uppercase action, String input); @AtlasActionProcessor static Character uppercaseChar(UppercaseChar action, Character input); static final String STRING_SEPARATOR_REGEX; static final Pattern STRING_SEPARATOR_PATTERN; }