Package net.bytebuddy.dynamic.scaffold
Interface RecordComponentRegistry
- All Known Implementing Classes:
RecordComponentRegistry.Default
public interface RecordComponentRegistry
A record component registry represents an extendable collection of record components which are identified by their names that are mapped
to a given
RecordComponentAttributeAppender
. Record components
can be uniquely identified by their name for a given type since record components are never inherited.
This registry is the counterpart of a
MethodRegistry
.
However, a record component registry is implemented simpler since it does not have to deal with complex signatures or
inheritance. For the sake of consistency, the record component registry follows however a similar pattern without introducing
unnecessary complexity.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Represents a compiled record component registry.static class
An immutable default implementation of a record component registry. -
Method Summary
Modifier and TypeMethodDescriptioncompile
(TypeDescription instrumentedType) Prepares the record component registry for a given instrumented type.prepend
(LatentMatcher<? super RecordComponentDescription> matcher, RecordComponentAttributeAppender.Factory recordComponentAttributeAppenderFactory, Transformer<RecordComponentDescription> transformer) Prepends the given record component definition to this record component registry, i.e.
-
Method Details
-
prepend
RecordComponentRegistry prepend(LatentMatcher<? super RecordComponentDescription> matcher, RecordComponentAttributeAppender.Factory recordComponentAttributeAppenderFactory, Transformer<RecordComponentDescription> transformer) Prepends the given record component definition to this record component registry, i.e. this configuration is applied first.- Parameters:
matcher
- The matcher to identify any record component that this definition concerns.recordComponentAttributeAppenderFactory
- The record component attribute appender factory to apply on any matched record component.transformer
- The record component transformer to apply to any matched record component.- Returns:
- An adapted version of this method registry.
-
compile
Prepares the record component registry for a given instrumented type.- Parameters:
instrumentedType
- The instrumented type.- Returns:
- A prepared record component registry.
-