Record Class RecordComponentMetadata
java.lang.Object
java.lang.Record
cloud.opencode.base.classloader.metadata.RecordComponentMetadata
public record RecordComponentMetadata(String name, String type, String genericType, List<AnnotationMetadata> annotations)
extends Record
Record Component Metadata - Immutable record component information
Record 组件元数据 - 不可变的 Record 组件信息
Represents metadata of a record component, including name, type, generic type and annotations.
表示 Record 组件的元数据,包括名称、类型、泛型类型和注解。
Features | 主要功能:
- Component name and type - 组件名称和类型
- Generic type information - 泛型类型信息
- Annotation information - 注解信息
Usage Examples | 使用示例:
RecordComponentMetadata component = classMetadata.getRecordComponents().get(0);
String name = component.name();
String type = component.type();
String genericType = component.genericType();
List<AnnotationMetadata> annotations = component.annotations();
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是 (不可变)
- Null-safe: Yes - 空值安全: 是
- Since:
- JDK 25, opencode-base-classloader V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRecordComponentMetadata(String name, String type, String genericType, List<AnnotationMetadata> annotations) Compact constructor with defensive copying and null checks 紧凑构造器,进行防御性拷贝和空值校验 -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theannotationsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegenericTyperecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
RecordComponentMetadata
public RecordComponentMetadata(String name, String type, String genericType, List<AnnotationMetadata> annotations) Compact constructor with defensive copying and null checks 紧凑构造器,进行防御性拷贝和空值校验- Parameters:
name- component name | 组件名称type- component type | 组件类型genericType- generic type | 泛型类型annotations- component annotations | 组件注解
-
-
Method Details
-
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
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
genericType
Returns the value of thegenericTyperecord component.- Returns:
- the value of the
genericTyperecord component
-
annotations
Returns the value of theannotationsrecord component.- Returns:
- the value of the
annotationsrecord component
-