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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder for an optional field definition.static interfaceA builder for a field definition that allows for defining a value. -
Method Summary
Modifier and TypeMethodDescriptionannotateField(Annotation... annotation) Annotates the previously defined or matched field with the supplied annotations.annotateField(Collection<? extends AnnotationDescription> annotations) Annotates the previously defined or matched field with the supplied annotations.annotateField(List<? extends Annotation> annotations) Annotates the previously defined or matched field with the supplied annotations.annotateField(AnnotationDescription... annotation) 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.transform(Transformer<FieldDescription> transformer) Applies the supplied transformer onto the previously defined or matched field.
-
Method Details
-
annotateField
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(List<? extends 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
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(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 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.
-