Package net.bytebuddy.dynamic.scaffold
Class FieldRegistry.Default
java.lang.Object
net.bytebuddy.dynamic.scaffold.FieldRegistry.Default
- All Implemented Interfaces:
FieldRegistry
- Enclosing interface:
- FieldRegistry
An immutable default implementation of a field registry.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A compiled default field registry.protected static class
An entry of the default field registry.Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.FieldRegistry
FieldRegistry.Default
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<FieldRegistry.Default.Entry>
This registries entries. -
Constructor Summary
ConstructorsModifierConstructorDescriptionDefault()
Creates a new empty default field registry.private
Default
(List<FieldRegistry.Default.Entry> entries) Creates a new default field registry. -
Method Summary
Modifier and TypeMethodDescriptioncompile
(TypeDescription instrumentedType) Prepares the field registry for a given instrumented type.prepend
(LatentMatcher<? super FieldDescription> matcher, FieldAttributeAppender.Factory fieldAttributeAppenderFactory, Object defaultValue, Transformer<FieldDescription> transformer) Prepends the given field definition to this field registry, i.e.
-
Field Details
-
entries
This registries entries.
-
-
Constructor Details
-
Default
public Default()Creates a new empty default field registry. -
Default
Creates a new default field registry.- Parameters:
entries
- The entries of the field registry.
-
-
Method Details
-
prepend
public FieldRegistry prepend(LatentMatcher<? super FieldDescription> matcher, FieldAttributeAppender.Factory fieldAttributeAppenderFactory, @MaybeNull Object defaultValue, Transformer<FieldDescription> transformer) Prepends the given field definition to this field registry, i.e. this configuration is applied first.- Specified by:
prepend
in interfaceFieldRegistry
- Parameters:
matcher
- The matcher to identify any field that this definition concerns.fieldAttributeAppenderFactory
- The field attribute appender factory to apply on any matched field.defaultValue
- The default value to write to the field ornull
if no default value is to be set for the field.transformer
- The field transformer to apply to any matched field.- Returns:
- An adapted version of this method registry.
-
compile
Prepares the field registry for a given instrumented type.- Specified by:
compile
in interfaceFieldRegistry
- Parameters:
instrumentedType
- The instrumented type.- Returns:
- A prepared field registry.
-