Class AsyncEmailSender.Builder

java.lang.Object
cloud.opencode.base.email.sender.AsyncEmailSender.Builder
Enclosing class:
AsyncEmailSender

public static class AsyncEmailSender.Builder extends Object
Builder for AsyncEmailSender AsyncEmailSender构建器
Since:
JDK 25, opencode-base-email V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • sender

      public AsyncEmailSender.Builder sender(cloud.opencode.base.email.internal.EmailSender sender)
      Set delegate sender 设置代理发送器
      Parameters:
      sender - the sender | 发送器
      Returns:
      this builder | 构建器
    • config

      public AsyncEmailSender.Builder config(EmailConfig config)
      Set delegate sender from config 从配置设置代理发送器
      Parameters:
      config - the email config | 邮件配置
      Returns:
      this builder | 构建器
    • executor

      public AsyncEmailSender.Builder executor(ExecutorService executor)
      Set custom executor 设置自定义执行器
      Parameters:
      executor - the executor | 执行器
      Returns:
      this builder | 构建器
    • retryExecutor

      public AsyncEmailSender.Builder retryExecutor(EmailRetryExecutor retryExecutor)
      Set retry executor 设置重试执行器
      Parameters:
      retryExecutor - the retry executor | 重试执行器
      Returns:
      this builder | 构建器
    • corePoolSize

      public AsyncEmailSender.Builder corePoolSize(int corePoolSize)
      Set core pool size (for platform threads) 设置核心线程池大小(用于平台线程)
      Parameters:
      corePoolSize - core pool size | 核心线程池大小
      Returns:
      this builder | 构建器
    • maxPoolSize

      public AsyncEmailSender.Builder maxPoolSize(int maxPoolSize)
      Set max pool size (for platform threads) 设置最大线程池大小(用于平台线程)
      Parameters:
      maxPoolSize - max pool size | 最大线程池大小
      Returns:
      this builder | 构建器
    • queueCapacity

      public AsyncEmailSender.Builder queueCapacity(int queueCapacity)
      Set queue capacity (for platform threads) 设置队列容量(用于平台线程)
      Parameters:
      queueCapacity - queue capacity | 队列容量
      Returns:
      this builder | 构建器
    • threadNamePrefix

      public AsyncEmailSender.Builder threadNamePrefix(String prefix)
      Set thread name prefix 设置线程名称前缀
      Parameters:
      prefix - the prefix | 前缀
      Returns:
      this builder | 构建器
    • useVirtualThreads

      public AsyncEmailSender.Builder useVirtualThreads(boolean useVirtualThreads)
      Use virtual threads (default: true) 使用虚拟线程(默认: true)
      Parameters:
      useVirtualThreads - true to use virtual threads | true使用虚拟线程
      Returns:
      this builder | 构建器
    • build

      public AsyncEmailSender build()
      Build the async sender 构建异步发送器
      Returns:
      the async sender | 异步发送器