class StringComplexFieldActions implements AtlasFieldAction {

    @AtlasActionProcessor
    public static String subStringAfter(SubStringAfter subStringAfter, String input) {
        if (input == null || input.length() == 0) {
            return input;
        }

        if (subStringAfter == null || subStringAfter.getStartIndex() == null
                || subStringAfter.getStartIndex() < 0 || subStringAfter.getMatch() == null
                || (subStringAfter.getEndIndex() != null
                        && subStringAfter.getEndIndex() < subStringAfter.getStartIndex())) {
            throw new IllegalArgumentException(
                    "SubStringAfter action must be specified with a positive startIndex and a string to match");
        }

        int idx = input.indexOf(subStringAfter.getMatch());
        if (idx < 0) {
            return input;
        }
        idx = idx + subStringAfter.getMatch().length();
        return doSubString(input.substring(idx), subStringAfter.getStartIndex(), subStringAfter.getEndIndex());
    }

}