Class ParameterSpecImpl
java.lang.Object
org.tquadrat.foundation.javacomposer.internal.ParameterSpecImpl
- All Implemented Interfaces:
ParameterSpec
@ClassVersion(sourceVersion="$Id: ParameterSpecImpl.java 1085 2024-01-05 16:23:28Z tquadrat $")
@API(status=INTERNAL,
since="0.0.5")
public final class ParameterSpecImpl
extends Object
implements ParameterSpec
The implementation of
ParameterSpec.- Author:
- Square,Inc.
- Modified by:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: ParameterSpecImpl.java 1085 2024-01-05 16:23:28Z tquadrat $
- Since:
- 0.0.5
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.javacomposer.internal.ParameterSpecImpl"
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.tquadrat.foundation.javacomposer.ParameterSpec
ParameterSpec.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<AnnotationSpecImpl> The annotations of this parameter.Lazily initialised return value oftoString()for this instance.private final JavaComposerThe reference to the factory.private final CodeBlockImplThe Javadoc comment for this type.The modifiers of this parameter.private final StringThe name of this parameter.private final TypeNameImplThe type of this parameter. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newParameterSpecImplinstance. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidemit(CodeWriter codeWriter, boolean varargs) Emits the parameter to the given code writer.final booleanfinal JavaComposerReturns theJavaComposerfactory.final inthashCode()final booleanhasModifier(Modifier modifier) Checks whether this parameter has the given modifier.private final StringThe initializer form_CachedString.javadoc()Returns the Javadoc comment for this parameter.final Stringname()Returns the name of this parameter.Returns a builder that is initialised with the components of this parameter.toBuilder(TypeName type, CharSequence name, boolean keepJavadoc) Returns a builder for a parameter with the given type and name, and that is initialised with the components of this parameter.final StringtoString()final TypeNameImpltype()Returns the type of this parameter.
-
Field Details
-
m_Annotations
The annotations of this parameter. -
m_CachedString
Lazily initialised return value oftoString()for this instance. -
m_Composer
The reference to the factory. -
m_Javadoc
The Javadoc comment for this type. -
m_Modifiers
The modifiers of this parameter. -
m_Name
The name of this parameter. -
m_Type
The type of this parameter.
-
-
Constructor Details
-
ParameterSpecImpl
Creates a newParameterSpecImplinstance.- Parameters:
builder- The builder.
-
-
Method Details
-
emit
Emits the parameter to the given code writer.- Parameters:
codeWriter- The code writer.varargs-trueif this parameter is avarargparameter,falseif it is a regular parameter.- Throws:
UncheckedIOException- A problem occurred when writing to the output target.
-
equals
- Specified by:
equalsin interfaceParameterSpec- Overrides:
equalsin classObject
-
getFactory
Returns theJavaComposerfactory.- Returns:
- The reference to the factory.
-
hashCode
- Specified by:
hashCodein interfaceParameterSpec- Overrides:
hashCodein classObject
-
hasModifier
Checks whether this parameter has the given modifier.- Specified by:
hasModifierin interfaceParameterSpec- Parameters:
modifier- The modifier.- Returns:
trueif the parameter has the given modifier,falseif not.
-
initializeCachedString
The initializer form_CachedString.- Returns:
- The return value for
toString().
-
javadoc
Returns the Javadoc comment for this parameter.- Returns:
- An instance of
Optionalthat holds the JavaDoc comment.
-
name
Returns the name of this parameter.- Specified by:
namein interfaceParameterSpec- Returns:
- The name.
-
toBuilder
Returns a builder that is initialised with the components of this parameter.- Specified by:
toBuilderin interfaceParameterSpec- Returns:
- The builder.
-
toBuilder
public final ParameterSpecImpl.BuilderImpl toBuilder(TypeName type, CharSequence name, boolean keepJavadoc) Returns a builder for a parameter with the given type and name, and that is initialised with the components of this parameter.- Specified by:
toBuilderin interfaceParameterSpec- Parameters:
type- The type for the new parameter.name- The name for the new parameter.keepJavadoc-trueif an existing Javadoc comment should be preserved,falseif it should be dropped.- Returns:
- The builder.
-
toString
- Specified by:
toStringin interfaceParameterSpec- Overrides:
toStringin classObject
-
type
Returns the type of this parameter.- Specified by:
typein interfaceParameterSpec- Returns:
- The type
-
