// Path: a-foundation/src/main/java/com/ajjpj/afoundation/function/AStatement1.java
// public interface AStatement1<P, E extends Throwable> extends Serializable {
//     void apply(P param) throws E;
// }


import com.ajjpj.afoundation.function.AFunction0NoThrow;
import com.ajjpj.afoundation.function.AFunction1NoThrow;
import com.ajjpj.afoundation.function.AStatement1;
import com.ajjpj.afoundation.function.AStatement1NoThrow;
    public AThreadPoolBuilder withDaemonThreads (boolean daemonThreads) {
        this.isDaemon = daemonThreads;
        return this;
    }

    public AThreadPoolBuilder withThreadNamePrefix (String threadNamePrefix) {
        this.threadNameFactory = new DefaultThreadNameFactory (threadNamePrefix);
        return this;
    }

    public AThreadPoolBuilder withThreadNameFactory (AFunction0NoThrow<String> threadNameFactory) {
        this.threadNameFactory = threadNameFactory;
        return this;
    }

    public AThreadPoolBuilder withExceptionHandler (AStatement1NoThrow<Throwable> exceptionHandler) {
        this.exceptionHandler = exceptionHandler;
        return this;
    }

    public AThreadPoolBuilder withSharedQueueAffinityStrategy (ASharedQueueAffinityStrategy sharedQueueAffinityStrategy) {
        this.sharedQueueAffinityStrategy = sharedQueueAffinityStrategy;
        return this;
    }

    public AThreadPoolBuilder withWorkerThreadLifecycleCallback (AWorkerThreadLifecycleCallback callback) {
        this.workerThreadLifecycleCallback = callback;
        return this;
    }

// Path: a-foundation/src/main/java/com/ajjpj/afoundation/function/AStatement1.java
// public interface AStatement1<P, E extends Throwable> extends Serializable {
//     void apply(P param) throws E;
// }


// Path: a-foundation/src/main/java/com/ajjpj/afoundation/concurrent/AThreadPoolBuilder.java
import com.ajjpj.afoundation.function.AFunction0NoThrow;
import com.ajjpj.afoundation.function.AFunction1NoThrow;
import com.ajjpj.afoundation.function.AStatement1;
import com.ajjpj.afoundation.function.AStatement1NoThrow;

    public AThreadPoolBuilder withDaemonThreads (boolean daemonThreads) {
        this.isDaemon = daemonThreads;
        return this;
    }

    public AThreadPoolBuilder withThreadNamePrefix (String threadNamePrefix) {
        this.threadNameFactory = new DefaultThreadNameFactory (threadNamePrefix);
        return this;
    }

    public AThreadPoolBuilder withThreadNameFactory (AFunction0NoThrow<String> threadNameFactory) {
        this.threadNameFactory = threadNameFactory;
        return this;
    }

    public AThreadPoolBuilder withExceptionHandler (AStatement1NoThrow<Throwable> exceptionHandler) {
        this.exceptionHandler = exceptionHandler;
        return this;
    }

    public AThreadPoolBuilder withSharedQueueAffinityStrategy (ASharedQueueAffinityStrategy sharedQueueAffinityStrategy) {
        this.sharedQueueAffinityStrategy = sharedQueueAffinityStrategy;
        return this;
    }

    public AThreadPoolBuilder withWorkerThreadLifecycleCallback (AWorkerThreadLifecycleCallback callback) {
        this.workerThreadLifecycleCallback = callback;
        return this;
    }

    public <T extends Throwable> AThreadPoolBuilder log (AStatement1<String, T> logOperation) throws T {