io.hyperfoil.core.builders.DependencyStepBuilder Maven / Gradle / Ivy
package io.hyperfoil.core.builders;
import java.util.ArrayList;
import java.util.Collection;
import io.hyperfoil.api.session.Access;
import io.hyperfoil.core.session.SessionFactory;
public abstract class DependencyStepBuilder> extends BaseStepBuilder {
private Collection dependencies = new ArrayList<>();
/**
* This step is blocked if this variable does not have set value (none by default).
*
* @param var Variable name.
* @return Self.
*/
@SuppressWarnings("unchecked")
public S dependency(String var) {
if (var != null) {
dependencies.add(SessionFactory.access(var));
}
return (S) this;
}
protected Access[] dependencies() {
return dependencies.toArray(new Access[0]);
}
}