class StringComplexFieldActions implements AtlasFieldAction {

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

}