class StringComplexFieldActions implements AtlasFieldAction {

    @AtlasActionProcessor
    public static String replaceAll(ReplaceAll replaceAll, String input) {
        if (replaceAll == null || replaceAll.getMatch() == null || replaceAll.getMatch().isEmpty()) {
            throw new IllegalArgumentException("ReplaceAll action must be specified with a non-empty old string");
        }
        String match = replaceAll.getMatch();
        String newString = replaceAll.getNewString();
        return input == null ? null : input.replaceAll(match, newString == null ? "" : newString);
    }

}