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 java.lang.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
Fields Modifier and Type Field Description private java.lang.ObjectdefaultValueThe default value to write to the field ornullif no default value is to be set for the field.private FieldAttributeAppender.FactoryfieldAttributeAppenderFactoryThe field attribute appender factory to apply on any matched field.private LatentMatcher<? super FieldDescription>matcherThe matcher to identify any field that this definition concerns.private Transformer<FieldDescription>transformerThe field transformer to apply to any matched field.
-
Constructor Summary
Constructors Modifier Constructor Description protectedEntry(LatentMatcher<? super FieldDescription> matcher, FieldAttributeAppender.Factory fieldAttributeAppenderFactory, java.lang.Object defaultValue, Transformer<FieldDescription> transformer)Creates a new entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectgetDefaultValue()Returns the default value to write to the field ornullif no default value is to be set for the field.protected FieldAttributeAppender.FactorygetFieldAttributeAppenderFactory()Returns the field attribute appender factory to apply on any matched field.protected Transformer<FieldDescription>getTransformer()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 Detail
-
matcher
private final LatentMatcher<? super FieldDescription> matcher
The matcher to identify any field that this definition concerns.
-
fieldAttributeAppenderFactory
private final FieldAttributeAppender.Factory fieldAttributeAppenderFactory
The field attribute appender factory to apply on any matched field.
-
defaultValue
@MaybeNull @ValueHandling(REVERSE_NULLABILITY) private final java.lang.Object defaultValue
The default value to write to the field ornullif no default value is to be set for the field.
-
transformer
private final Transformer<FieldDescription> transformer
The field transformer to apply to any matched field.
-
-
Constructor Detail
-
Entry
protected Entry(LatentMatcher<? super FieldDescription> matcher, FieldAttributeAppender.Factory fieldAttributeAppenderFactory, @MaybeNull java.lang.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 ornullif no default value is to be set for the field.transformer- The field transformer to apply to any matched field.
-
-
Method Detail
-
getFieldAttributeAppenderFactory
protected FieldAttributeAppender.Factory 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
@MaybeNull protected java.lang.Object getDefaultValue()
Returns the default value to write to the field ornullif no default value is to be set for the field.- Returns:
- The default value to write to the field or
nullif no default value is to be set for the field.
-
getTransformer
protected Transformer<FieldDescription> getTransformer()
Returns the field transformer to apply to any matched field.- Returns:
- The field transformer to apply to any matched field.
-
resolve
public ElementMatcher<? super FieldDescription> resolve(TypeDescription typeDescription)
Resolves the element matcher this instance represents for the supplied type description.- Specified by:
resolvein interfaceLatentMatcher<FieldDescription>- Parameters:
typeDescription- The type description for which the represented matcher should be resolved.- Returns:
- An
ElementMatcherthat represents this matcher's resolved form.
-
-