Class FieldSpecImpl.BuilderImpl
java.lang.Object
org.tquadrat.foundation.javacomposer.internal.FieldSpecImpl.BuilderImpl
- All Implemented Interfaces:
FieldSpec.Builder
- Enclosing class:
FieldSpecImpl
@ClassVersion(sourceVersion="$Id: FieldSpecImpl.java 1105 2024-02-28 12:58:46Z tquadrat $")
@API(status=INTERNAL,
since="0.0.5")
public static final class FieldSpecImpl.BuilderImpl
extends Object
implements FieldSpec.Builder
The implementation of
FieldSpec.Builder- Author:
- Square,Inc.
- Modified by:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: FieldSpecImpl.java 1105 2024-02-28 12:58:46Z tquadrat $
- Since:
- 0.0.5
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.javacomposer.internal.FieldSpecImpl.BuilderImpl"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection<AnnotationSpecImpl> The annotations for the field.private final JavaComposerThe reference to the factory.private CodeBlockImplThe initializer for the field.private final CodeBlockImpl.BuilderImplThe Javadoc comment for the field.The modifiers for the field.private final StringThe name for the field.private final TypeNameImplThe type for the field. -
Constructor Summary
ConstructorsConstructorDescriptionBuilderImpl(JavaComposer composer, TypeNameImpl type, CharSequence name) Creates a newBuilderImplinstance. -
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.final FieldSpecImplbuild()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.
-
Field Details
-
m_Annotations
The annotations for the field. -
m_Composer
The reference to the factory. -
m_Initializer
The initializer for the field. -
m_Javadoc
The Javadoc comment for the field. -
m_Modifiers
The modifiers for the field. -
m_Name
The name for the field. -
m_Type
The type for the field.
-
-
Constructor Details
-
BuilderImpl
Creates a newBuilderImplinstance.- Parameters:
composer- The reference to the factory that created this builder instance.type- The type for the new field.name- The name for the new field.
-
-
Method Details
-
addAnnotation
Adds an annotation for the field.- Specified by:
addAnnotationin interfaceFieldSpec.Builder- Parameters:
annotationSpec- The annotation.- Returns:
- This
Builderinstance.
-
addAnnotation
Adds an annotation for the field.- Specified by:
addAnnotationin interfaceFieldSpec.Builder- Parameters:
annotation- The annotation.- Returns:
- This
Builderinstance.
-
addAnnotation
Adds an annotation for the field.- Specified by:
addAnnotationin interfaceFieldSpec.Builder- Parameters:
annotation- The annotation.- Returns:
- This
Builderinstance.
-
addAnnotations
Adds annotations for the field.- Specified by:
addAnnotationsin interfaceFieldSpec.Builder- Parameters:
annotationSpecs- The annotations.- Returns:
- This
Builderinstance.
-
addJavadoc
Adds a Javadoc comment for the field.- Specified by:
addJavadocin interfaceFieldSpec.Builder- Parameters:
block- The comment block.- Returns:
- This
Builderinstance.
-
addJavadoc
Adds a Javadoc comment for the field.- Specified by:
addJavadocin interfaceFieldSpec.Builder- Parameters:
format- The format.args- The arguments.- Returns:
- This
Builderinstance.
-
addModifiers
Adds modifiers for the field.- Specified by:
addModifiersin interfaceFieldSpec.Builder- Parameters:
modifiers- The modifiers.- Returns:
- This
Builderinstance.
-
build
Builds a newFieldSpecinstance from the added components.- Specified by:
buildin interfaceFieldSpec.Builder- Returns:
- The
FieldSpecinstance.
-
initializer
Sets the initializer for the field.- Specified by:
initializerin interfaceFieldSpec.Builder- Parameters:
codeBlock- The code that initialises the field.- Returns:
- This
Builderinstance.
-
initializer
Sets the initializer for the field.- Specified by:
initializerin interfaceFieldSpec.Builder- Parameters:
format- The format.args- The arguments.- Returns:
- This
Builderinstance.
-
