io.hyperfoil.api.config.ServiceLoadedContract Maven / Gradle / Ivy
package io.hyperfoil.api.config;
import java.util.function.Consumer;
/**
* Fill-in the builder provided in {@link #builder()} and then call {@link #complete()}.
*/
public final class ServiceLoadedContract {
private final B builder;
private final Consumer consumer;
public ServiceLoadedContract(B builder, Consumer consumer) {
this.builder = builder;
this.consumer = consumer;
}
public B builder() {
return builder;
}
public void complete() {
consumer.accept(builder);
}
}