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

io.hyperfoil.api.config.Locator Maven / Gradle / Ivy

There is a newer version: 0.27
Show newest version
package io.hyperfoil.api.config;

public interface Locator {

   StepBuilder step();

   BaseSequenceBuilder sequence();

   ScenarioBuilder scenario();

   static Locator fromStep(StepBuilder step) {
      if (!step.canBeLocated()) {
         throw new IllegalStateException(step + " cannot be located as it does not support deep copy.");
      }
      return new Step(step);
   }

   class Step implements Locator {
      private final StepBuilder step;

      private Step(StepBuilder step) {
         this.step = step;
      }

      public StepBuilder step() {
         return step;
      }

      public BaseSequenceBuilder sequence() {
         return step.endStep();
      }

      public ScenarioBuilder scenario() {
         return step.endStep().endSequence();
      }
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy