net.openhft.chronicle.testframework.Delegation Maven / Gradle / Ivy
package net.openhft.chronicle.testframework;
import net.openhft.chronicle.testframework.internal.DelegationBuilder;
import org.jetbrains.annotations.NotNull;
import java.util.function.Function;
import static java.util.Objects.requireNonNull;
/**
* Utility class to build delegator instances that forward method invocations
* to a specified delegate object. This class facilitates a fluent API for customizing
* the behavior of the delegator.
*
* This class cannot be instantiated.
*/
public final class Delegation {
// Suppresses default constructor, ensuring non-instantiability.
private Delegation() {
}
/**
* Creates and returns a new builder for a delegator instance that will use the provided
* {@code delegate} as the delegate. Method invocations on the built instance will be delegated to the
* provided delegate.
*
* @param delegate The object to delegate invocations to
* @param Provided delegate type
* @return New delegator builder
* @throws NullPointerException if the provided delegate is {@code null}.
*/
public static Builder