Class DynamicType.Builder.AbstractBase.Adapter.FieldMatchAdapter
java.lang.Object
net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase<U>
net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase.Delegator<U>
net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition.Optional.AbstractBase<U>
net.bytebuddy.dynamic.DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase<U>
net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase.Adapter.FieldMatchAdapter
- All Implemented Interfaces:
DynamicType.Builder<U>, DynamicType.Builder.FieldDefinition<U>, DynamicType.Builder.FieldDefinition.Optional<U>, DynamicType.Builder.FieldDefinition.Optional.Valuable<U>, DynamicType.Builder.FieldDefinition.Valuable<U>
- Enclosing class:
DynamicType.Builder.AbstractBase.Adapter<U>
@Enhance(includeSyntheticFields=true)
protected class DynamicType.Builder.AbstractBase.Adapter.FieldMatchAdapter
extends DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase<U>
An adapter for matching an existing field.
-
Nested Class Summary
Nested classes/interfaces inherited from class DynamicType.Builder.AbstractBase
DynamicType.Builder.AbstractBase.Delegator<U>, DynamicType.Builder.AbstractBase.UsingTypeWriter<U>Nested classes/interfaces inherited from interface DynamicType.Builder
DynamicType.Builder.AbstractBase<S>, DynamicType.Builder.FieldDefinition<S>, DynamicType.Builder.InnerTypeDefinition<S>, DynamicType.Builder.MethodDefinition<S>, DynamicType.Builder.ModuleDefinition<S>, DynamicType.Builder.RecordComponentDefinition<S>, DynamicType.Builder.TypeVariableDefinition<S>Nested classes/interfaces inherited from interface DynamicType.Builder.FieldDefinition
DynamicType.Builder.FieldDefinition.Optional<U>, DynamicType.Builder.FieldDefinition.Valuable<U>Nested classes/interfaces inherited from interface DynamicType.Builder.FieldDefinition.Optional
DynamicType.Builder.FieldDefinition.Optional.AbstractBase<U>, DynamicType.Builder.FieldDefinition.Optional.Valuable<V>Nested classes/interfaces inherited from interface DynamicType.Builder.FieldDefinition.Optional.Valuable
DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase<U> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ObjectThe field's default value ornullif no value is to be defined.protected final FieldAttributeAppender.FactoryThe field attribute appender factory to apply.protected final Transformer<FieldDescription> The field transformer to apply. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFieldMatchAdapter(FieldAttributeAppender.Factory fieldAttributeAppenderFactory, Transformer<FieldDescription> transformer, Object defaultValue, LatentMatcher<? super FieldDescription> matcher) Creates a new field match adapter.protectedFieldMatchAdapter(LatentMatcher<? super FieldDescription> matcher) Creates a new field match adapter. -
Method Summary
Modifier and TypeMethodDescriptionannotateField(Collection<? extends AnnotationDescription> annotations) Annotates the previously defined or matched field with the supplied annotations.attribute(FieldAttributeAppender.Factory fieldAttributeAppenderFactory) Applies the supplied attribute appender factory onto the previously defined or matched field.protected DynamicType.Builder.FieldDefinition.Optional<U> defaultValue(Object defaultValue) Defines the supplied value as a default value of the previously defined or matched field.protected DynamicType.Builder<U> Creates a new builder that realizes the current state of the builder.protected DynamicType.Builder.FieldDefinition.Optional<U> materialize(FieldAttributeAppender.Factory fieldAttributeAppenderFactory, Transformer<FieldDescription> transformer, Object defaultValue) Creates a new optional field definition for which all of the supplied values are represented.transform(Transformer<FieldDescription> transformer) Applies the supplied transformer onto the previously defined or matched field.Methods inherited from class DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase
value, value, value, value, value, valueMethods inherited from class DynamicType.Builder.FieldDefinition.Optional.AbstractBase
annotateField, annotateField, annotateFieldMethods inherited from class DynamicType.Builder.AbstractBase.Delegator
adjustModule, adjustModule, annotateType, attribute, declaredTypes, define, defineConstructor, defineField, defineMethod, defineRecordComponent, field, ignoreAlso, ignoreAlso, implement, initializer, initializer, innerTypeOf, innerTypeOf, invokable, make, make, make, make, merge, modifiers, module, name, nestHost, nestMembers, permittedSubclass, recordComponent, recordComponent, require, suffix, topLevelType, toTypeDescription, transform, typeVariable, unsealed, visit, wrap, wrapMethods inherited from class DynamicType.Builder.AbstractBase
annotateType, annotateType, annotateType, constructor, declaredTypes, declaredTypes, declaredTypes, define, define, define, define, define, defineConstructor, defineConstructor, defineField, defineField, defineField, defineField, defineField, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineProperty, defineProperty, defineProperty, defineProperty, defineRecordComponent, field, implement, implement, implement, innerTypeOf, innerTypeOf, innerTypeOf, invokable, merge, method, modifiers, modifiers, module, module, nestHost, nestMembers, nestMembers, nestMembers, noNestMate, permittedSubclass, permittedSubclass, permittedSubclass, require, require, require, serialVersionUid, typeVariable, typeVariable, typeVariable, typeVariable, withHashCodeEquals, withToString, wrap, wrapMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DynamicType.Builder
adjustModule, adjustModule, annotateType, annotateType, annotateType, annotateType, attribute, constructor, declaredTypes, declaredTypes, declaredTypes, declaredTypes, define, define, define, define, define, define, defineConstructor, defineConstructor, defineConstructor, defineField, defineField, defineField, defineField, defineField, defineField, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineProperty, defineProperty, defineProperty, defineProperty, defineRecordComponent, defineRecordComponent, field, field, ignoreAlso, ignoreAlso, implement, implement, implement, implement, initializer, initializer, innerTypeOf, innerTypeOf, innerTypeOf, innerTypeOf, innerTypeOf, invokable, invokable, make, make, make, make, merge, merge, method, modifiers, modifiers, modifiers, module, module, module, name, nestHost, nestHost, nestMembers, nestMembers, nestMembers, nestMembers, noNestMate, permittedSubclass, permittedSubclass, permittedSubclass, permittedSubclass, recordComponent, recordComponent, require, require, require, require, serialVersionUid, suffix, topLevelType, toTypeDescription, transform, typeVariable, typeVariable, typeVariable, typeVariable, typeVariable, unsealed, visit, withHashCodeEquals, withToString, wrap, wrap, wrap, wrapMethods inherited from interface DynamicType.Builder.FieldDefinition
annotateField, annotateField, annotateField
-
Field Details
-
fieldAttributeAppenderFactory
The field attribute appender factory to apply. -
transformer
The field transformer to apply. -
defaultValue
The field's default value ornullif no value is to be defined.
-
-
Constructor Details
-
FieldMatchAdapter
Creates a new field match adapter.- Parameters:
matcher- The matcher for any fields to apply this matcher to.
-
FieldMatchAdapter
protected FieldMatchAdapter(FieldAttributeAppender.Factory fieldAttributeAppenderFactory, Transformer<FieldDescription> transformer, @MaybeNull Object defaultValue, LatentMatcher<? super FieldDescription> matcher) Creates a new field match adapter.- Parameters:
fieldAttributeAppenderFactory- The field attribute appender factory to apply.transformer- The field transformer to apply.defaultValue- The field's default value ornullif no value is to be defined.matcher- The matcher for any fields to apply this matcher to.
-
-
Method Details
-
annotateField
public DynamicType.Builder.FieldDefinition.Optional<U> annotateField(Collection<? extends AnnotationDescription> annotations) Annotates the previously defined or matched field with the supplied annotations.- Parameters:
annotations- The annotations to declare on the previously defined or matched field.- Returns:
- A new builder that is equal to this builder but with the given annotations declared on the previously defined or matched field.
-
materialize
Description copied from class:DynamicType.Builder.AbstractBase.DelegatorCreates a new builder that realizes the current state of the builder.- Specified by:
materializein classDynamicType.Builder.AbstractBase.Delegator<U>- Returns:
- A new builder that realizes the current state of the builder.
-
materialize
protected DynamicType.Builder.FieldDefinition.Optional<U> materialize(FieldAttributeAppender.Factory fieldAttributeAppenderFactory, Transformer<FieldDescription> transformer, @MaybeNull Object defaultValue) Creates a new optional field definition for which all of the supplied values are represented.- Parameters:
fieldAttributeAppenderFactory- The field attribute appender factory to apply.transformer- The field transformer to apply.defaultValue- The field's default value ornullif no value is to be defined.- Returns:
- A new field definition that represents the supplied values.
-
attribute
public DynamicType.Builder.FieldDefinition.Optional<U> attribute(FieldAttributeAppender.Factory fieldAttributeAppenderFactory) Applies the supplied attribute appender factory onto the previously defined or matched field.- Parameters:
fieldAttributeAppenderFactory- The field attribute appender factory that should be applied on the previously defined or matched field.- Returns:
- A new builder that is equal to this builder but with the supplied field attribute appender factory applied to the previously defined or matched field.
-
transform
public DynamicType.Builder.FieldDefinition.Optional<U> transform(Transformer<FieldDescription> transformer) Applies the supplied transformer onto the previously defined or matched field. The transformed field is written as it is and is not subject to any validations.- Parameters:
transformer- The transformer to apply to the previously defined or matched field.- Returns:
- A new builder that is equal to this builder but with the supplied field transformer applied to the previously defined or matched field.
-
defaultValue
Description copied from class:DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBaseDefines the supplied value as a default value of the previously defined or matched field.- Specified by:
defaultValuein classDynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase<V>- Parameters:
defaultValue- The value to define as a default value of the defined field.- Returns:
- A new builder that is equal to this builder but with the given default value declared for the previously defined or matched field.
-