Class TypeName.BuilderBase<BUILDER extends TypeName.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends TypeName>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
TypeName.Builder
- Enclosing interface:
TypeName
TypeName.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAnnotation(Annotation annotation) List of declared and known annotations for this element.addAnnotation(Consumer<Annotation.Builder> consumer) List of declared and known annotations for this element.addAnnotations(List<? extends Annotation> annotations) List of declared and known annotations for this element.addEnclosingName(String enclosingName) Simple names of enclosing classes (if any exist).addEnclosingNames(List<String> enclosingNames) Simple names of enclosing classes (if any exist).addInheritedAnnotation(Annotation inheritedAnnotation) List of all inherited annotations for this element.addInheritedAnnotation(Consumer<Annotation.Builder> consumer) List of all inherited annotations for this element.addInheritedAnnotations(List<? extends Annotation> inheritedAnnotations) List of all inherited annotations for this element.addLowerBound(TypeName lowerBound) Generic types that provide keywordextendswill have a lower bound defined.addLowerBound(Consumer<TypeName.Builder> consumer) Generic types that provide keywordextendswill have a lower bound defined.addLowerBounds(List<? extends TypeName> lowerBounds) Generic types that provide keywordextendswill have a lower bound defined.addTypeArgument(TypeName typeArgument) Returns the list of generic type arguments, or an empty list if no generics are in use.addTypeArgument(Consumer<TypeName.Builder> consumer) Returns the list of generic type arguments, or an empty list if no generics are in use.addTypeArguments(List<? extends TypeName> typeArguments) Returns the list of generic type arguments, or an empty list if no generics are in use.addTypeParameter(String typeParameter) Type parameters associated with the type arguments.addTypeParameters(List<String> typeParameters) Type parameters associated with the type arguments.addUpperBound(TypeName upperBound) Generic types that provide keywordsuperwill have an upper bound defined.addUpperBound(Consumer<TypeName.Builder> consumer) Generic types that provide keywordsuperwill have an upper bound defined.addUpperBounds(List<? extends TypeName> upperBounds) Generic types that provide keywordsuperwill have an upper bound defined.List of declared and known annotations for this element.annotations(List<? extends Annotation> annotations) List of declared and known annotations for this element.booleanarray()Functions similar toClass.isArray().array(boolean array) Functions similar toClass.isArray().Functions similar toClass.getSimpleName().Functions similar toClass.getSimpleName().Clear all annotations.Clear existing value of componentType.Clear all enclosingNames.Clear all inheritedAnnotations.Clear all lowerBounds.Clear all typeArguments.Clear all typeParameters.Clear all upperBounds.Component type of array.componentType(TypeName componentType) Component type of array.componentType(Consumer<TypeName.Builder> consumer) Component type of array.componentType(Supplier<? extends TypeName> supplier) Component type of array.Simple names of enclosing classes (if any exist).enclosingNames(List<String> enclosingNames) Simple names of enclosing classes (if any exist).Update this builder from an existing prototype instance.from(TypeName.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.booleangeneric()Indicates whether this type is using generics.generic(boolean generic) Indicates whether this type is using generics.List of all inherited annotations for this element.inheritedAnnotations(List<? extends Annotation> inheritedAnnotations) List of all inherited annotations for this element.Generic types that provide keywordextendswill have a lower bound defined.lowerBounds(List<? extends TypeName> lowerBounds) Generic types that provide keywordextendswill have a lower bound defined.Functions similar toClass.getPackageName().packageName(String packageName) Functions similar toClass.getPackageName().protected voidHandles providers and decorators.booleanFunctions similar toClass.isPrimitive().primitive(boolean primitive) Functions similar toClass.isPrimitive().toString()Update builder from the provided type.Returns the list of generic type arguments, or an empty list if no generics are in use.typeArguments(List<? extends TypeName> typeArguments) Returns the list of generic type arguments, or an empty list if no generics are in use.Type parameters associated with the type arguments.typeParameters(List<String> typeParameters) Type parameters associated with the type arguments.Generic types that provide keywordsuperwill have an upper bound defined.upperBounds(List<? extends TypeName> upperBounds) Generic types that provide keywordsuperwill have an upper bound defined.protected voidValidates required properties.booleanvararg()If this is a representation ofTypeName.array(), this method can identify that it was declared as a vararg.vararg(boolean vararg) If this is a representation ofTypeName.array(), this method can identify that it was declared as a vararg.booleanwildcard()Indicates whether this type is using wildcard generics.wildcard(boolean wildcard) Indicates whether this type is using wildcard generics.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
type
Update builder from the provided type.- Parameters:
type- type to get information (package name, class name, primitive, array)- Returns:
- updated builder instance
-
packageName
Functions similar toClass.getPackageName().- Parameters:
packageName- the package name, never null- Returns:
- updated builder instance
- See Also:
-
className
Functions similar toClass.getSimpleName().- Parameters:
className- the simple class name- Returns:
- updated builder instance
- See Also:
-
clearEnclosingNames
Clear all enclosingNames.- Returns:
- updated builder instance
- See Also:
-
enclosingNames
Simple names of enclosing classes (if any exist). For example for typeio.helidon.example.Type$NestOne$NestTwo, this would return a list ofType, NestOne.- Parameters:
enclosingNames- enclosing classes simple names- Returns:
- updated builder instance
- See Also:
-
addEnclosingNames
Simple names of enclosing classes (if any exist). For example for typeio.helidon.example.Type$NestOne$NestTwo, this would return a list ofType, NestOne.- Parameters:
enclosingNames- enclosing classes simple names- Returns:
- updated builder instance
- See Also:
-
addEnclosingName
Simple names of enclosing classes (if any exist). For example for typeio.helidon.example.Type$NestOne$NestTwo, this would return a list ofType, NestOne.- Parameters:
enclosingName- add single enclosing classes simple names- Returns:
- updated builder instance
- See Also:
-
primitive
Functions similar toClass.isPrimitive().- Parameters:
primitive- true if this type represents a primitive type- Returns:
- updated builder instance
- See Also:
-
array
Functions similar toClass.isArray().- Parameters:
array- true if this type represents a primitive array []- Returns:
- updated builder instance
- See Also:
-
vararg
If this is a representation ofTypeName.array(), this method can identify that it was declared as a vararg. This may be used for method/constructor parameters (which is the only place this is supported in Java).- Parameters:
vararg- whether an array is declared as a vararg- Returns:
- updated builder instance
- See Also:
-
generic
Indicates whether this type is using generics.- Parameters:
generic- used to represent a generic (e.g., "Optional<CB>")- Returns:
- updated builder instance
- See Also:
-
wildcard
Indicates whether this type is using wildcard generics.- Parameters:
wildcard- used to represent a wildcard (e.g., "? extends SomeType")- Returns:
- updated builder instance
- See Also:
-
clearTypeArguments
Clear all typeArguments.- Returns:
- updated builder instance
- See Also:
-
typeArguments
Returns the list of generic type arguments, or an empty list if no generics are in use.- Parameters:
typeArguments- the type arguments of this type, if this type supports generics/parameterized type- Returns:
- updated builder instance
- See Also:
-
addTypeArguments
Returns the list of generic type arguments, or an empty list if no generics are in use.- Parameters:
typeArguments- the type arguments of this type, if this type supports generics/parameterized type- Returns:
- updated builder instance
- See Also:
-
addTypeArgument
Returns the list of generic type arguments, or an empty list if no generics are in use.- Parameters:
typeArgument- add single the type arguments of this type, if this type supports generics/parameterized type- Returns:
- updated builder instance
- See Also:
-
addTypeArgument
Returns the list of generic type arguments, or an empty list if no generics are in use.- Parameters:
consumer- consumer of builder for the type arguments of this type, if this type supports generics/parameterized type- Returns:
- updated builder instance
- See Also:
-
clearTypeParameters
Clear all typeParameters.- Returns:
- updated builder instance
- See Also:
-
typeParameters
Type parameters associated with the type arguments. The type argument list may be empty, even if this list is not, for example in declaration of the top level type (as arguments are a function of usage of the type). iftypeArguments()exist, this list MUST exist and have the same size and order (it maps the name to the type).- Parameters:
typeParameters- type parameter names as declared on this type, or names that represent thetypeArguments()- Returns:
- updated builder instance
- See Also:
-
addTypeParameters
Type parameters associated with the type arguments. The type argument list may be empty, even if this list is not, for example in declaration of the top level type (as arguments are a function of usage of the type). iftypeArguments()exist, this list MUST exist and have the same size and order (it maps the name to the type).- Parameters:
typeParameters- type parameter names as declared on this type, or names that represent thetypeArguments()- Returns:
- updated builder instance
- See Also:
-
addTypeParameter
Type parameters associated with the type arguments. The type argument list may be empty, even if this list is not, for example in declaration of the top level type (as arguments are a function of usage of the type). iftypeArguments()exist, this list MUST exist and have the same size and order (it maps the name to the type).- Parameters:
typeParameter- add single type parameter names as declared on this type, or names that represent thetypeArguments()- Returns:
- updated builder instance
- See Also:
-
clearLowerBounds
Clear all lowerBounds.- Returns:
- updated builder instance
- See Also:
-
lowerBounds
Generic types that provide keywordextendswill have a lower bound defined. Each lower bound may be a real type, or another generic type.This list may only have value if this is a generic type.
- Parameters:
lowerBounds- list of lower bounds of this type- Returns:
- updated builder instance
- See Also:
-
addLowerBounds
Generic types that provide keywordextendswill have a lower bound defined. Each lower bound may be a real type, or another generic type.This list may only have value if this is a generic type.
- Parameters:
lowerBounds- list of lower bounds of this type- Returns:
- updated builder instance
- See Also:
-
addLowerBound
Generic types that provide keywordextendswill have a lower bound defined. Each lower bound may be a real type, or another generic type.This list may only have value if this is a generic type.
- Parameters:
lowerBound- add single list of lower bounds of this type- Returns:
- updated builder instance
- See Also:
-
addLowerBound
Generic types that provide keywordextendswill have a lower bound defined. Each lower bound may be a real type, or another generic type.This list may only have value if this is a generic type.
- Parameters:
consumer- consumer of builder for list of lower bounds of this type- Returns:
- updated builder instance
- See Also:
-
clearUpperBounds
Clear all upperBounds.- Returns:
- updated builder instance
- See Also:
-
upperBounds
Generic types that provide keywordsuperwill have an upper bound defined. Upper bound may be a real type, or another generic type.This list may only have value if this is a generic type.
- Parameters:
upperBounds- list of upper bounds of this type- Returns:
- updated builder instance
- See Also:
-
addUpperBounds
Generic types that provide keywordsuperwill have an upper bound defined. Upper bound may be a real type, or another generic type.This list may only have value if this is a generic type.
- Parameters:
upperBounds- list of upper bounds of this type- Returns:
- updated builder instance
- See Also:
-
addUpperBound
Generic types that provide keywordsuperwill have an upper bound defined. Upper bound may be a real type, or another generic type.This list may only have value if this is a generic type.
- Parameters:
upperBound- add single list of upper bounds of this type- Returns:
- updated builder instance
- See Also:
-
addUpperBound
Generic types that provide keywordsuperwill have an upper bound defined. Upper bound may be a real type, or another generic type.This list may only have value if this is a generic type.
- Parameters:
consumer- consumer of builder for list of upper bounds of this type- Returns:
- updated builder instance
- See Also:
-
clearComponentType
Clear existing value of componentType.- Returns:
- updated builder instance
- See Also:
-
componentType
Component type of array.- Parameters:
componentType- component type of array- Returns:
- updated builder instance
- See Also:
-
componentType
Component type of array.- Parameters:
consumer- consumer of builder of component type of array- Returns:
- updated builder instance
- See Also:
-
componentType
Component type of array.- Parameters:
supplier- supplier of component type of array- Returns:
- updated builder instance
- See Also:
-
clearAnnotations
Clear all annotations.- Returns:
- updated builder instance
- See Also:
-
annotations
List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as theof the annotation).- Parameters:
annotations- the list of annotations declared on this element- Returns:
- updated builder instance
- See Also:
-
addAnnotations
List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as theof the annotation).- Parameters:
annotations- the list of annotations declared on this element- Returns:
- updated builder instance
- See Also:
-
addAnnotation
List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as theof the annotation).- Parameters:
annotation- add single the list of annotations declared on this element- Returns:
- updated builder instance
- See Also:
-
addAnnotation
List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as theof the annotation).- Parameters:
consumer- consumer of builder for the list of annotations declared on this element- Returns:
- updated builder instance
- See Also:
-
clearInheritedAnnotations
Clear all inheritedAnnotations.- Returns:
- updated builder instance
- See Also:
-
inheritedAnnotations
List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked asInherited.The returned list does not contain
annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.This method does not return annotations on super types or interfaces!
- Parameters:
inheritedAnnotations- list of all meta annotations of this element- Returns:
- updated builder instance
- See Also:
-
addInheritedAnnotations
List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked asInherited.The returned list does not contain
annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.This method does not return annotations on super types or interfaces!
- Parameters:
inheritedAnnotations- list of all meta annotations of this element- Returns:
- updated builder instance
- See Also:
-
addInheritedAnnotation
List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked asInherited.The returned list does not contain
annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.This method does not return annotations on super types or interfaces!
- Parameters:
inheritedAnnotation- add single list of all meta annotations of this element- Returns:
- updated builder instance
- See Also:
-
addInheritedAnnotation
List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked asInherited.The returned list does not contain
annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.This method does not return annotations on super types or interfaces!
- Parameters:
consumer- consumer of builder for list of all meta annotations of this element- Returns:
- updated builder instance
- See Also:
-
packageName
Functions similar toClass.getPackageName().- Returns:
- the package name, never null
-
className
Functions similar toClass.getSimpleName().- Returns:
- the simple class name
-
enclosingNames
Simple names of enclosing classes (if any exist). For example for typeio.helidon.example.Type$NestOne$NestTwo, this would return a list ofType, NestOne.- Returns:
- enclosing classes simple names
-
primitive
public boolean primitive()Functions similar toClass.isPrimitive().- Returns:
- true if this type represents a primitive type
-
array
public boolean array()Functions similar toClass.isArray().- Returns:
- true if this type represents a primitive array []
-
vararg
public boolean vararg()If this is a representation ofTypeName.array(), this method can identify that it was declared as a vararg. This may be used for method/constructor parameters (which is the only place this is supported in Java).- Returns:
- whether an array is declared as a vararg
-
generic
public boolean generic()Indicates whether this type is using generics.- Returns:
- used to represent a generic (e.g., "Optional<CB>")
-
wildcard
public boolean wildcard()Indicates whether this type is using wildcard generics.- Returns:
- used to represent a wildcard (e.g., "? extends SomeType")
-
typeArguments
Returns the list of generic type arguments, or an empty list if no generics are in use.- Returns:
- the type arguments of this type, if this type supports generics/parameterized type
- See Also:
-
typeParameters
Type parameters associated with the type arguments. The type argument list may be empty, even if this list is not, for example in declaration of the top level type (as arguments are a function of usage of the type). iftypeArguments()exist, this list MUST exist and have the same size and order (it maps the name to the type).- Returns:
- type parameter names as declared on this type, or names that represent the
typeArguments()
-
lowerBounds
Generic types that provide keywordextendswill have a lower bound defined. Each lower bound may be a real type, or another generic type.This list may only have value if this is a generic type.
- Returns:
- list of lower bounds of this type
- See Also:
-
upperBounds
Generic types that provide keywordsuperwill have an upper bound defined. Upper bound may be a real type, or another generic type.This list may only have value if this is a generic type.
- Returns:
- list of upper bounds of this type
- See Also:
-
componentType
Component type of array.- Returns:
- component type of array
-
annotations
List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as theof the annotation).- Returns:
- the list of annotations declared on this element
-
inheritedAnnotations
List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked asInherited.The returned list does not contain
annotations(). If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.This method does not return annotations on super types or interfaces!
- Returns:
- list of all meta annotations of this element
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-