Class AlwaysOffStrategy

java.lang.Object
cloud.opencode.base.feature.strategy.AlwaysOffStrategy
All Implemented Interfaces:
EnableStrategy

public class AlwaysOffStrategy extends Object implements EnableStrategy
Always Off Strategy 始终禁用策略

Strategy that always returns false (feature disabled).

始终返回false(功能禁用)的策略。

Usage Examples | 使用示例:

Feature feature = Feature.builder("always-off")
    .strategy(AlwaysOffStrategy.INSTANCE)
    .build();

// or using builder shortcut
Feature feature = Feature.builder("always-off")
    .alwaysOff()
    .build();

Features | 主要功能:

  • Unconditionally disables features - 无条件禁用功能
  • Zero-overhead evaluation - 零开销评估

Security | 安全性:

  • Thread-safe: Yes - 线程安全: 是
  • Null-safe: No - 空值安全: 否
Since:
JDK 25, opencode-base-feature V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Field Details

    • INSTANCE

      public static final AlwaysOffStrategy INSTANCE
      Singleton instance 单例实例
  • Method Details

    • isEnabled

      public boolean isEnabled(Feature feature, FeatureContext context)
      Always returns false 始终返回false
      Specified by:
      isEnabled in interface EnableStrategy
      Parameters:
      feature - the feature | 功能
      context - the context | 上下文
      Returns:
      always false | 始终为false
    • toString

      public String toString()
      Overrides:
      toString in class Object