Package net.bytebuddy.dynamic
Interface DynamicType.Builder.FieldDefinition<S>
-
- Type Parameters:
S
- A loaded type that the built type is guaranteed to be a subclass of.
- All Known Subinterfaces:
DynamicType.Builder.FieldDefinition.Optional<U>
,DynamicType.Builder.FieldDefinition.Optional.Valuable<V>
,DynamicType.Builder.FieldDefinition.Valuable<U>
- All Known Implementing Classes:
DynamicType.Builder.AbstractBase.Adapter.FieldDefinitionAdapter
,DynamicType.Builder.AbstractBase.Adapter.FieldMatchAdapter
,DynamicType.Builder.FieldDefinition.Optional.AbstractBase
,DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase
,DynamicType.Builder.FieldDefinition.Optional.Valuable.AbstractBase.Adapter
- Enclosing interface:
- DynamicType.Builder<T>
public static interface DynamicType.Builder.FieldDefinition<S>
A builder for a field definition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
DynamicType.Builder.FieldDefinition.Optional<U>
A builder for an optional field definition.static interface
DynamicType.Builder.FieldDefinition.Valuable<U>
A builder for a field definition that allows for defining a value.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DynamicType.Builder.FieldDefinition.Optional<S>
annotateField(java.lang.annotation.Annotation... annotation)
Annotates the previously defined or matched field with the supplied annotations.DynamicType.Builder.FieldDefinition.Optional<S>
annotateField(java.util.Collection<? extends AnnotationDescription> annotations)
Annotates the previously defined or matched field with the supplied annotations.DynamicType.Builder.FieldDefinition.Optional<S>
annotateField(java.util.List<? extends java.lang.annotation.Annotation> annotations)
Annotates the previously defined or matched field with the supplied annotations.DynamicType.Builder.FieldDefinition.Optional<S>
annotateField(AnnotationDescription... annotation)
Annotates the previously defined or matched field with the supplied annotations.DynamicType.Builder.FieldDefinition.Optional<S>
attribute(FieldAttributeAppender.Factory fieldAttributeAppenderFactory)
Applies the supplied attribute appender factory onto the previously defined or matched field.DynamicType.Builder.FieldDefinition.Optional<S>
transform(Transformer<FieldDescription> transformer)
Applies the supplied transformer onto the previously defined or matched field.
-
-
-
Method Detail
-
annotateField
DynamicType.Builder.FieldDefinition.Optional<S> annotateField(java.lang.annotation.Annotation... annotation)
Annotates the previously defined or matched field with the supplied annotations.- Parameters:
annotation
- 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.
-
annotateField
DynamicType.Builder.FieldDefinition.Optional<S> annotateField(java.util.List<? extends java.lang.annotation.Annotation> 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.
-
annotateField
DynamicType.Builder.FieldDefinition.Optional<S> annotateField(AnnotationDescription... annotation)
Annotates the previously defined or matched field with the supplied annotations.- Parameters:
annotation
- 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.
-
annotateField
DynamicType.Builder.FieldDefinition.Optional<S> annotateField(java.util.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.
-
attribute
DynamicType.Builder.FieldDefinition.Optional<S> 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
DynamicType.Builder.FieldDefinition.Optional<S> transform(Transformer<FieldDescription> transformer)
Applies the supplied transformer onto the previously defined or matched field. The transformed field is written as it is and it 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.
-
-