Class Feature.Builder
java.lang.Object
cloud.opencode.base.feature.Feature.Builder
- Enclosing class:
Feature
Builder for Feature
Feature构建器
- Since:
- JDK 25, opencode-base-feature V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet always off strategy 设置始终禁用策略alwaysOn()Set always on strategy 设置始终启用策略build()Build the feature 构建功能defaultEnabled(boolean enabled) Set default enabled state 设置默认启用状态description(String description) Set description 设置描述expiresAfter(Duration duration) Set expiration as a duration from now 设置从现在开始的过期持续时间Set expiration time 设置过期时间Set user list strategy 设置用户列表策略Set user list strategy 设置用户列表策略Set feature group 设置功能组lifecycle(FeatureLifecycle lifecycle) Set lifecycle state 设置生命周期状态Add metadata entry 添加元数据条目Add all metadata from map 从映射添加所有元数据Set display name 设置显示名称percentage(int percent) Set percentage strategy 设置百分比策略strategy(EnableStrategy strategy) Set enable strategy 设置启用策略
-
Constructor Details
-
Builder
-
-
Method Details
-
name
Set display name 设置显示名称- Parameters:
name- the display name | 显示名称- Returns:
- this builder | 此构建器
-
description
Set description 设置描述- Parameters:
description- the description | 描述- Returns:
- this builder | 此构建器
-
defaultEnabled
Set default enabled state 设置默认启用状态- Parameters:
enabled- the default state | 默认状态- Returns:
- this builder | 此构建器
-
strategy
Set enable strategy 设置启用策略- Parameters:
strategy- the strategy | 策略- Returns:
- this builder | 此构建器
-
alwaysOn
-
alwaysOff
-
percentage
Set percentage strategy 设置百分比策略- Parameters:
percent- the percentage (0-100) | 百分比 (0-100)- Returns:
- this builder | 此构建器
-
forUsers
Set user list strategy 设置用户列表策略- Parameters:
userIds- the allowed user IDs | 允许的用户ID- Returns:
- this builder | 此构建器
-
forUsers
Set user list strategy 设置用户列表策略- Parameters:
userIds- the allowed user IDs | 允许的用户ID- Returns:
- this builder | 此构建器
-
metadata
Add metadata entry 添加元数据条目- Parameters:
key- the metadata key | 元数据键value- the metadata value | 元数据值- Returns:
- this builder | 此构建器
-
metadata
Add all metadata from map 从映射添加所有元数据- Parameters:
metadata- the metadata map | 元数据映射- Returns:
- this builder | 此构建器
-
group
Set feature group 设置功能组- Parameters:
group- the group name | 组名称- Returns:
- this builder | 此构建器
-
expiresAt
Set expiration time 设置过期时间- Parameters:
expiresAt- the expiration instant | 过期时间点- Returns:
- this builder | 此构建器
-
expiresAfter
Set expiration as a duration from now 设置从现在开始的过期持续时间- Parameters:
duration- the duration until expiration | 到过期的持续时间- Returns:
- this builder | 此构建器
-
lifecycle
Set lifecycle state 设置生命周期状态- Parameters:
lifecycle- the lifecycle state | 生命周期状态- Returns:
- this builder | 此构建器
-
build
-