Package net.bytebuddy.dynamic.scaffold
Class FieldRegistry.Default.Compiled.Entry
java.lang.Object
net.bytebuddy.dynamic.scaffold.FieldRegistry.Default.Compiled.Entry
- All Implemented Interfaces:
ElementMatcher<FieldDescription>
- Enclosing class:
FieldRegistry.Default.Compiled
@Enhance
protected static class FieldRegistry.Default.Compiled.Entry
extends Object
implements ElementMatcher<FieldDescription>
An entry of a compiled field registry.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Object
The default value to write to the field ornull
if no default value is to be set for the field.private final FieldAttributeAppender
The field attribute appender to apply on any matched field.private final ElementMatcher
<? super FieldDescription> The matcher to identify any field that this definition concerns.private final Transformer
<FieldDescription> The field transformer to apply to any matched field. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Entry
(ElementMatcher<? super FieldDescription> matcher, FieldAttributeAppender fieldAttributeAppender, Object defaultValue, Transformer<FieldDescription> transformer) Creates a new entry. -
Method Summary
Modifier and TypeMethodDescriptionprotected TypeWriter.FieldPool.Record
bind
(TypeDescription instrumentedType, FieldDescription fieldDescription) Binds this entry to the provided field description.boolean
matches
(FieldDescription target) Matches a target against this element matcher.
-
Field Details
-
matcher
The matcher to identify any field that this definition concerns. -
fieldAttributeAppender
The field attribute appender 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.
-
-
Constructor Details
-
Entry
protected Entry(ElementMatcher<? super FieldDescription> matcher, FieldAttributeAppender fieldAttributeAppender, @MaybeNull Object defaultValue, Transformer<FieldDescription> transformer) Creates a new entry.- Parameters:
matcher
- The matcher to identify any field that this definition concerns.fieldAttributeAppender
- The field attribute appender 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.
-
-
Method Details
-
bind
protected TypeWriter.FieldPool.Record bind(TypeDescription instrumentedType, FieldDescription fieldDescription) Binds this entry to the provided field description.- Parameters:
instrumentedType
- The instrumented type for which this entry applies.fieldDescription
- The field description to be bound to this entry.- Returns:
- A record representing the binding of this entry to the provided field.
-
matches
Matches a target against this element matcher.- Specified by:
matches
in interfaceElementMatcher<FieldDescription>
- Parameters:
target
- The instance to be matched ornull
.- Returns:
true
if the given element is matched by this matcher orfalse
otherwise.
-