Interface FieldSpec.Builder
- All Known Implementing Classes:
FieldSpecImpl.BuilderImpl
- Enclosing interface:
FieldSpec
@ClassVersion(sourceVersion="$Id: FieldSpec.java 1085 2024-01-05 16:23:28Z tquadrat $")
@API(status=STABLE,
since="0.0.5")
public static sealed interface FieldSpec.Builder
permits FieldSpecImpl.BuilderImpl
The specification of a builder for an instance of an implementation for
FieldSpec- Author:
- Square,Inc.
- Modified by:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: FieldSpec.java 1085 2024-01-05 16:23:28Z tquadrat $
- Since:
- 0.0.5
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.javacomposer.FieldSpec.Builder"
-
Method Summary
Modifier and TypeMethodDescriptionaddAnnotation(Class<?> annotation) Adds an annotation for the field.addAnnotation(AnnotationSpec annotationSpec) Adds an annotation for the field.addAnnotation(ClassName annotation) Adds an annotation for the field.addAnnotations(Iterable<AnnotationSpec> annotationSpecs) Adds annotations for the field.addJavadoc(String format, Object... args) Adds a Javadoc comment for the field.addJavadoc(CodeBlock block) Adds a Javadoc comment for the field.addModifiers(Modifier... modifiers) Adds modifiers for the field.build()Builds a newFieldSpecinstance from the added components.initializer(String format, Object... args) Sets the initializer for the field.initializer(CodeBlock codeBlock) Sets the initializer for the field.
-
Method Details
-
addAnnotation
Adds an annotation for the field.- Parameters:
annotationSpec- The annotation.- Returns:
- This
Builderinstance.
-
addAnnotation
Adds an annotation for the field.- Parameters:
annotation- The annotation.- Returns:
- This
Builderinstance.
-
addAnnotation
Adds an annotation for the field.- Parameters:
annotation- The annotation.- Returns:
- This
Builderinstance.
-
addAnnotations
Adds annotations for the field.- Parameters:
annotationSpecs- The annotations.- Returns:
- This
Builderinstance.
-
addJavadoc
Adds a Javadoc comment for the field.- Parameters:
block- The comment block.- Returns:
- This
Builderinstance.
-
addJavadoc
Adds a Javadoc comment for the field.- Parameters:
format- The format.args- The arguments.- Returns:
- This
Builderinstance.
-
addModifiers
Adds modifiers for the field.- Parameters:
modifiers- The modifiers.- Returns:
- This
Builderinstance.
-
build
Builds a newFieldSpecinstance from the added components.- Returns:
- The
FieldSpecinstance.
-
initializer
Sets the initializer for the field.- Parameters:
codeBlock- The code that initialises the field.- Returns:
- This
Builderinstance.
-
initializer
Sets the initializer for the field.- Parameters:
format- The format.args- The arguments.- Returns:
- This
Builderinstance.
-
