Class FeatureProxy.Builder<T>

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

public static class FeatureProxy.Builder<T> extends Object
Builder for FeatureProxy FeatureProxy构建器
Since:
JDK 25, opencode-base-feature V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • features

      public FeatureProxy.Builder<T> features(OpenFeature features)
      Set the OpenFeature instance 设置OpenFeature实例
      Parameters:
      features - the OpenFeature instance | OpenFeature实例
      Returns:
      this builder | 此构建器
    • contextSupplier

      public FeatureProxy.Builder<T> contextSupplier(Supplier<FeatureContext> contextSupplier)
      Set the context supplier for dynamic context 设置动态上下文的上下文供应器
      Parameters:
      contextSupplier - supplier that provides context for each method call | 为每次方法调用提供上下文的供应器
      Returns:
      this builder | 此构建器
    • whenDisabled

      public FeatureProxy.Builder<T> whenDisabled(FeatureProxy.DisabledBehavior behavior)
      Set behavior when feature is disabled 设置功能禁用时的行为
      Parameters:
      behavior - the behavior | 行为
      Returns:
      this builder | 此构建器
    • build

      public T build()
      Build the proxy 构建代理
      Returns:
      proxied instance | 代理实例