package hibergui.verify;

public class OrConstraint implements Constraint {

    Constraint[] subconstraints;
    
    public OrConstraint(Constraint c1, Constraint c2) {
        subconstraints = new Constraint[]{c1, c2};
    }

    public OrConstraint(Constraint[] c) {
        subconstraints = c;
    }

    public boolean check(Object o) {
        for (Constraint c: subconstraints)
            if (c.check(o))
                return true;
        return false;
    }

}
