Record Class FeatureGroup
java.lang.Object
java.lang.Record
cloud.opencode.base.feature.FeatureGroup
- Record Components:
name- the group name | 组名称description- the group description | 组描述featureKeys- the set of feature keys in this group | 此组中的功能键集合Security | 安全性:
- Thread-safe: Yes (immutable record) - 线程安全: 是(不可变记录)
- Null-safe: Partial (validates inputs) - 空值安全: 部分(验证输入)
Feature Group
功能组
Immutable record representing a group of related features.
表示一组相关功能的不可变记录。
Features | 主要功能:
- Group features by name - 按名称分组功能
- Check membership - 检查成员资格
- Immutable feature key set - 不可变功能键集合
Usage Examples | 使用示例:
FeatureGroup group = new FeatureGroup("payment", "Payment features",
Set.of("pay-v2", "pay-refund"));
boolean contains = group.contains("pay-v2"); // true
int size = group.size(); // 2
- Since:
- JDK 25, opencode-base-feature V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureGroup(String name, String description, Set<String> featureKeys) Compact constructor with validation 带验证的紧凑构造函数 -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if this group contains the given feature key 检查此组是否包含给定的功能键Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefeatureKeysrecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.intsize()Get the number of features in this group 获取此组中的功能数量final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FeatureGroup
-
-
Method Details
-
contains
Check if this group contains the given feature key 检查此组是否包含给定的功能键- Parameters:
key- the feature key | 功能键- Returns:
- true if contains | 如果包含返回true
-
size
public int size()Get the number of features in this group 获取此组中的功能数量- Returns:
- the size | 大小
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
name
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
featureKeys
Returns the value of thefeatureKeysrecord component.- Returns:
- the value of the
featureKeysrecord component
-