Class OpenEvent.Builder

java.lang.Object
cloud.opencode.base.event.OpenEvent.Builder
Enclosing class:
OpenEvent

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

    • Builder

      public Builder()
  • Method Details

    • asyncExecutor

      public OpenEvent.Builder asyncExecutor(ExecutorService executor)
      Set the async executor 设置异步执行器
      Parameters:
      executor - the executor service | 执行器服务
      Returns:
      this builder | 此构建器
    • syncDispatcher

      public OpenEvent.Builder syncDispatcher(EventDispatcher dispatcher)
      Set the sync dispatcher 设置同步分发器
      Parameters:
      dispatcher - the sync dispatcher | 同步分发器
      Returns:
      this builder | 此构建器
    • asyncDispatcher

      public OpenEvent.Builder asyncDispatcher(EventDispatcher dispatcher)
      Set the async dispatcher 设置异步分发器
      Parameters:
      dispatcher - the async dispatcher | 异步分发器
      Returns:
      this builder | 此构建器
    • eventStore

      public OpenEvent.Builder eventStore(EventStore store)
      Set the event store 设置事件存储
      Parameters:
      store - the event store | 事件存储
      Returns:
      this builder | 此构建器
    • exceptionHandler

      public OpenEvent.Builder exceptionHandler(EventExceptionHandler handler)
      Set the exception handler 设置异常处理器
      Parameters:
      handler - the exception handler | 异常处理器
      Returns:
      this builder | 此构建器
    • interceptor

      public OpenEvent.Builder interceptor(EventInterceptor interceptor)
      Add an event interceptor 添加事件拦截器
      Parameters:
      interceptor - the interceptor to add | 要添加的拦截器
      Returns:
      this builder | 此构建器
    • build

      public OpenEvent build()
      Build the OpenEvent instance 构建OpenEvent实例
      Returns:
      new OpenEvent instance | 新的OpenEvent实例