Package net.bytebuddy.dynamic.scaffold
Class FieldRegistry.Default.Entry
java.lang.Object
net.bytebuddy.dynamic.scaffold.FieldRegistry.Default.Entry
- All Implemented Interfaces:
LatentMatcher<FieldDescription>
- Enclosing class:
FieldRegistry.Default
@Enhance
protected static class FieldRegistry.Default.Entry
extends Object
implements LatentMatcher<FieldDescription>
An entry of the default field registry.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.LatentMatcher
LatentMatcher.Conjunction<S>, LatentMatcher.Disjunction<S>, LatentMatcher.ForFieldToken, LatentMatcher.ForMethodToken, LatentMatcher.ForRecordComponentToken, LatentMatcher.ForSelfDeclaredMethod, LatentMatcher.Resolved<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.Factory
The field attribute appender factory to apply on any matched field.private final LatentMatcher
<? 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
(LatentMatcher<? super FieldDescription> matcher, FieldAttributeAppender.Factory fieldAttributeAppenderFactory, Object defaultValue, Transformer<FieldDescription> transformer) Creates a new entry. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
Returns the default value to write to the field ornull
if no default value is to be set for the field.protected FieldAttributeAppender.Factory
Returns the field attribute appender factory to apply on any matched field.protected Transformer
<FieldDescription> Returns the field transformer to apply to any matched field.ElementMatcher
<? super FieldDescription> resolve
(TypeDescription typeDescription) Resolves the element matcher this instance represents for the supplied type description.
-
Field Details
-
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.
-
-
Constructor Details
-
Entry
protected Entry(LatentMatcher<? super FieldDescription> matcher, FieldAttributeAppender.Factory fieldAttributeAppenderFactory, @MaybeNull Object defaultValue, Transformer<FieldDescription> transformer) Creates a new entry.- 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.
-
-
Method Details
-
getFieldAttributeAppenderFactory
Returns the field attribute appender factory to apply on any matched field.- Returns:
- The field attribute appender factory to apply on any matched field.
-
getDefaultValue
Returns the default value to write to the field ornull
if no default value is to be set for the field.- Returns:
- The default value to write to the field or
null
if no default value is to be set for the field.
-
getTransformer
Returns the field transformer to apply to any matched field.- Returns:
- The field transformer to apply to any matched field.
-
resolve
Resolves the element matcher this instance represents for the supplied type description.- Specified by:
resolve
in interfaceLatentMatcher<FieldDescription>
- Parameters:
typeDescription
- The type description for which the represented matcher should be resolved.- Returns:
- An
ElementMatcher
that represents this matcher's resolved form.
-