org.nakedobjects.noa.reflect.checks.AbstractCheckOneToManyAssociationInstanceChain Maven / Gradle / Ivy
The newest version!
package org.nakedobjects.noa.reflect.checks;
import org.nakedobjects.noa.adapter.Naked;
import org.nakedobjects.noa.reflect.OneToManyAssociationInstance;
/**
* Adapter class for a chain of checks against a {@link OneToManyAssociationInstance}.
*
*/
public abstract class AbstractCheckOneToManyAssociationInstanceChain extends AbstractCheckOneToManyAssociationInstance {
public AbstractCheckOneToManyAssociationInstanceChain(
OneToManyAssociationInstance oneToManyAssociationInstance) {
super(oneToManyAssociationInstance);
}
private ChainHelper chainHelper = new ChainHelper();
/**
* Adds the check.
*
*
* If the supplied {@link Check} is a {@link CheckChain}, then
* its list of checks gets flattened.
*
* @param check
*/
public void addCheck(Check check) {
chainHelper.addCheck(check);
}
/**
* Checks all Checks that have been added.
*
* @return
*/
public String check(Naked[] values) {
return this.chainHelper.check(values);
}
}