
io.hyperfoil.api.config.BuilderBase Maven / Gradle / Ivy
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 extends BuilderBase> builders) {
return builders.stream().map(b -> b.copy(locator)).collect(Collectors.toList());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy