package org.simantics.interop.issues; import org.simantics.db.ReadGraph; import org.simantics.db.exception.DatabaseException; import org.simantics.db.request.Read; /** * AndRead can be used to combine multiple requests into single one. If all reads return true or null, this returns true. * @author Marko Luukkainen * */ public class AndRead implements Read{ private Read reads[]; public AndRead(Read... reads) { this.reads = reads; } @Override public Boolean perform(ReadGraph graph) throws DatabaseException { Boolean b = null; for (Read r : reads) { b = r.perform(graph); if(b != null && !b) return false; } return true; } }