Class AlwaysOnStrategy

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

public class AlwaysOnStrategy extends Object implements EnableStrategy
Always On Strategy 始终启用策略

Strategy that always returns true (feature enabled).

始终返回true(功能启用)的策略。

Usage Examples | 使用示例:

Feature feature = Feature.builder("always-on")
    .strategy(AlwaysOnStrategy.INSTANCE)
    .build();

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

Features | 主要功能:

  • Unconditionally enables 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 AlwaysOnStrategy INSTANCE
      Singleton instance 单例实例
  • Method Details

    • isEnabled

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

      public String toString()
      Overrides:
      toString in class Object