package hibergui.verify;

public class AndConstraint implements Constraint {
    
    Constraint[] subconstraints;
    
    public AndConstraint(Constraint c1, Constraint c2) {
        subconstraints = new Constraint[]{c1, c2};
    }

    public AndConstraint(Constraint... constraints) {
        subconstraints = constraints;
    }

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

}
