class StringComplexFieldActions implements AtlasFieldAction {

    @AtlasActionProcessor(sourceType = FieldType.ANY)
    public static String concatenate(Concatenate concat, List<String> inputs) {
        if (concat == null) {
            throw new IllegalArgumentException("Concatenate must be specified with a delimiter");
        }
        if (inputs == null) {
            return null;
        }

        String delim = concat.getDelimiter() == null ? "" : concat.getDelimiter();
        StringBuilder builder = new StringBuilder();
        boolean isFirst = true;
        for (String entry : inputs) {
            if (!isFirst) {
                builder.append(delim);
            }
            if (entry != null) {
                builder.append(entry);
            }
            isFirst = false;
        }

        return builder.toString();
    }

}