Class ProxyFactory.Builder<T>

java.lang.Object
cloud.opencode.base.reflect.proxy.ProxyFactory.Builder<T>
Type Parameters:
T - the interface type | 接口类型
Enclosing class:
ProxyFactory<T>

public static class ProxyFactory.Builder<T> extends Object
Builder for creating proxy with lambda-style configuration 用Lambda风格配置创建代理的构建器
Since:
JDK 25, opencode-base-reflect V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • of

      public static <T> ProxyFactory.Builder<T> of(Class<T> interfaceClass)
      Creates a builder for an interface 为接口创建构建器
      Type Parameters:
      T - the interface type | 接口类型
      Parameters:
      interfaceClass - the interface class | 接口类
      Returns:
      the builder | 构建器
    • handle

      public ProxyFactory.Builder<T> handle(BiFunction<Method,Object[],Object> handler)
      Sets the handler function 设置处理器函数
      Parameters:
      handler - the handler (method, args) -> result | 处理器
      Returns:
      this builder | 此构建器
    • build

      public T build()
      Creates the proxy 创建代理
      Returns:
      the proxy | 代理