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

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

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

import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Intended base for all builders that might need relocation when the step is copied over.
 */
public interface BuilderBase {
   default void prepareBuild() {}

   /**
    * Should be overridden if the locator parameter in {@link ServiceLoadedFactory#newBuilder(Locator, String)}
    * is used. If the locator is not used it is legal to return this.
    */
   default S copy(Locator locator) {
      return (S) this;
   }

   static  List copy(Locator locator, Collection> builders) {
      return builders.stream().map(b -> b.copy(locator)).collect(Collectors.toList());
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy