package org.dhatim.safesql.builder;

import java.util.ArrayList;
import java.util.Arrays;
import org.dhatim.safesql.SafeSqlAppendable;

public class Concat implements Operand {
    
    private final ArrayList<Operand> list = new ArrayList<>();

    public Concat(Operand left, Operand right) {
        list.add(left);
        list.add(right);
    }
    
    public Concat(Operand left, Operand right, Operand... others) {
        this(left, right);
        list.addAll(Arrays.asList(others));
    }
    
    @Override
    public void appendTo(SafeSqlAppendable builder) {
        builder.joinedSqlizables(" || ", list);
    }

}


@@ -83,16 +83,46 @@
 Arrays;%0A
+import java.util.Collection;%0A%0A
 import o
@@ -269,16 +269,232 @@
 t%3C%3E();%0A%0A
+    public Concat(Collection%3C? extends Operand%3E c) %7B%0A        if (c.size() %3C 2) %7B%0A            throw new IllegalArgumentException(%22A concat must have a least two element%22);%0A        %7D%0A        list.addAll(c);%0A    %7D%0A    %0A
     publ

Add collection constructor