Annotation Interface FeatureVariant
Feature Variant Annotation
功能变体注解
Annotation for marking methods as feature variants for A/B testing.
用于标记方法为A/B测试功能变体的注解。
Features | 主要功能:
- A/B testing support - A/B测试支持
- Multiple variants - 多变体支持
- Variant identification - 变体标识
Usage Examples | 使用示例:
@FeatureVariant(feature = "checkout-flow", variant = "A")
public void checkoutFlowA() {
// Original checkout flow
}
@FeatureVariant(feature = "checkout-flow", variant = "B")
public void checkoutFlowB() {
// New checkout flow for testing
}
@FeatureVariant(feature = "button-color", variant = "blue", percentage = 50)
public void renderBlueButton() {
// 50% of users see blue button
}
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是(不可变)
- Null-safe: N/A - 空值安全: 不适用
- Since:
- JDK 25, opencode-base-feature V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDescription of the variant 变体描述intPercentage of traffic for this variant (0-100) 此变体的流量百分比(0-100)
-
Element Details
-
feature
-
variant
String variantVariant identifier (e.g., "A", "B", "control", "experiment") 变体标识符(例如:"A"、"B"、"control"、"experiment")- Returns:
- variant identifier | 变体标识符
-
percentage
int percentagePercentage of traffic for this variant (0-100) 此变体的流量百分比(0-100)- Returns:
- traffic percentage | 流量百分比
- Default:
0
-
description
-