Annotation Interface Experimental


@Documented @Retention(RUNTIME) @Target({TYPE,METHOD,CONSTRUCTOR,FIELD}) public @interface Experimental
Marks an API as experimental. 标记一个 API 为实验性的。

Experimental APIs may change or be removed in future releases without notice. They are available for early feedback but should not be relied upon in production.

实验性 API 可能在未来版本中更改或删除,恕不另行通知。 它们可供早期反馈使用,但不应在生产环境中依赖。

Example / 示例:

@Experimental(since = "1.0.0", reason = "API shape may change based on community feedback")
public class ReactiveHttpClient { ... }

Features | 主要功能:

  • Mark APIs as experimental at type, method, constructor, or field level - 在类型、方法、构造器或字段级别标记API为实验性
  • Configurable since version and reason - 可配置起始版本和原因
  • Runtime retention for reflective access - 运行时保留以支持反射访问

Usage Examples | 使用示例:

@Experimental(since = "1.0.0", reason = "API shape may change")
public class NewFeature { }

Security | 安全性:

  • Thread-safe: Yes (annotation is immutable) - 线程安全: 是(注解不可变)
  • Null-safe: Yes - 空值安全: 是
Since:
JDK 25, opencode-base-core V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The reason this API is experimental.
    The version since which this API is experimental.
  • Element Details

    • since

      String since
      The version since which this API is experimental. 此 API 从哪个版本开始成为实验性的。
      Returns:
      the version string - 版本字符串
      Default:
      ""
    • reason

      String reason
      The reason this API is experimental. 此 API 成为实验性的原因。
      Returns:
      the reason - 原因
      Default:
      "API shape may change based on community feedback"