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
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.ForSelfDeclaredMethod, LatentMatcher.Resolved<S>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Entry(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.Object
getDefaultValue()
Returns the default value to write to the field ornull
if no default value is to be set for the field.protected FieldAttributeAppender.Factory
getFieldAttributeAppenderFactory()
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.
-
-
-
Constructor Detail
-
Entry
protected Entry(LatentMatcher<? super FieldDescription> matcher, FieldAttributeAppender.Factory fieldAttributeAppenderFactory, 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 ornull
if 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
protected java.lang.Object 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
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)
Description copied from interface:LatentMatcher
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.
-
-