Interface FeatureListener

All Known Implementing Classes:
MetricsFeatureListener
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface FeatureListener
Feature Listener Interface 功能监听器接口

Listener for feature change events.

功能变更事件的监听器。

Features | 主要功能:

  • Change notification - 变更通知
  • Audit logging - 审计日志
  • Cache invalidation - 缓存失效

Usage Examples | 使用示例:

OpenFeature.getInstance().addListener((key, oldValue, newValue) -> {
    log.info("Feature {} changed: {} -> {}", key, oldValue, newValue);
});

Security | 安全性:

  • Thread-safe: Implementation-dependent - 线程安全: 取决于实现
  • Null-safe: No - 空值安全: 否
Since:
JDK 25, opencode-base-feature V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onFeatureChanged(String key, boolean oldValue, boolean newValue)
    Called when a feature's enabled state changes 当功能的启用状态改变时调用
  • Method Details

    • onFeatureChanged

      void onFeatureChanged(String key, boolean oldValue, boolean newValue)
      Called when a feature's enabled state changes 当功能的启用状态改变时调用
      Parameters:
      key - the feature key | 功能键
      oldValue - the old enabled state | 旧的启用状态
      newValue - the new enabled state | 新的启用状态