All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hyperfoil.core.builders.DependencyStepBuilder Maven / Gradle / Ivy

There is a newer version: 0.27.1
Show newest version
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]);
   }
}