Module io.helidon.common.types
Package io.helidon.common.types
Class TypeName.BuilderBase<BUILDER extends TypeName.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends TypeName>
java.lang.Object
io.helidon.common.types.TypeName.BuilderBase<BUILDER,PROTOTYPE>
- 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
public abstract static class TypeName.BuilderBase<BUILDER extends TypeName.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends TypeName>
extends Object
implements Prototype.Builder<BUILDER,PROTOTYPE>
Fluent API builder base for
TypeName
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEnclosingName
(String enclosingName) Simple names of enclosing classes (if any exist).addEnclosingNames
(List<? extends String> enclosingNames) Simple names of enclosing classes (if any exist).addLowerBound
(TypeName lowerBound) Generic types that provide keywordextends
will have a lower bound defined.addLowerBound
(Consumer<TypeName.Builder> consumer) Generic types that provide keywordextends
will have a lower bound defined.addLowerBounds
(List<? extends TypeName> lowerBounds) Generic types that provide keywordextends
will 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) Deprecated, for removal: This API element is subject to removal in a future version.addTypeParameters
(List<? extends String> typeParameters) Type parameters associated with the type arguments.addUpperBound
(TypeName upperBound) Generic types that provide keywordsuper
will have an upper bound defined.addUpperBound
(Consumer<TypeName.Builder> consumer) Generic types that provide keywordsuper
will have an upper bound defined.addUpperBounds
(List<? extends TypeName> upperBounds) Generic types that provide keywordsuper
will have an upper bound defined.boolean
array()
Functions the same asClass.isArray()
.array
(boolean array) Functions the same asClass.isArray()
.Functions the same asClass.getSimpleName()
.Functions the same asClass.getSimpleName()
.Simple names of enclosing classes (if any exist).enclosingNames
(List<? extends 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.boolean
generic()
Indicates whether this type is using generics.generic
(boolean generic) Indicates whether this type is using generics.Generic types that provide keywordextends
will have a lower bound defined.lowerBounds
(List<? extends TypeName> lowerBounds) Generic types that provide keywordextends
will have a lower bound defined.Functions the same asClass.getPackageName()
.packageName
(String packageName) Functions the same asClass.getPackageName()
.protected void
Handles providers and decorators.boolean
Functions the same asClass.isPrimitive()
.primitive
(boolean primitive) Functions the same asClass.isPrimitive()
.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.Deprecated, for removal: This API element is subject to removal in a future version.theTypeNameBlueprint.typeArguments()
will contain all required informationtypeParameters
(List<? extends String> typeParameters) Type parameters associated with the type arguments.Generic types that provide keywordsuper
will have an upper bound defined.upperBounds
(List<? extends TypeName> upperBounds) Generic types that provide keywordsuper
will have an upper bound defined.protected void
Validates required properties.boolean
wildcard()
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, toString, wait, wait, wait
Methods 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), can only be a class or aGenericType
- Returns:
- updated builder instance
-
packageName
Functions the same asClass.getPackageName()
.- Parameters:
packageName
- the package name, never null- Returns:
- updated builder instance
- See Also:
-
className
Functions the same asClass.getSimpleName()
.- Parameters:
className
- the simple class name- 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
- enclosing classes simple names- Returns:
- updated builder instance
- See Also:
-
primitive
Functions the same asClass.isPrimitive()
.- Parameters:
primitive
- true if this type represents a primitive type- Returns:
- updated builder instance
- See Also:
-
array
Functions the same asClass.isArray()
.- Parameters:
array
- true if this type represents a primitive array []- 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:
-
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
- 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
- the type arguments of this type, if this type supports generics/parameterized type- 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
Deprecated, for removal: This API element is subject to removal in a future version.theTypeNameBlueprint.typeArguments()
will contain all required informationType 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
- type parameter names as declared on this type, or names that represent thetypeArguments()
- Returns:
- updated builder instance
- See Also:
-
lowerBounds
Generic types that provide keywordextends
will 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 keywordextends
will 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 keywordextends
will 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
- list of lower bounds of this type- Returns:
- updated builder instance
- See Also:
-
addLowerBound
Generic types that provide keywordextends
will 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
- list of lower bounds of this type- Returns:
- updated builder instance
- See Also:
-
upperBounds
Generic types that provide keywordsuper
will 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 keywordsuper
will 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 keywordsuper
will 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
- list of upper bounds of this type- Returns:
- updated builder instance
- See Also:
-
addUpperBound
Generic types that provide keywordsuper
will 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
- list of upper bounds of this type- Returns:
- updated builder instance
- See Also:
-
packageName
Functions the same asClass.getPackageName()
.- Returns:
- the package name
-
className
Functions the same asClass.getSimpleName()
.- Returns:
- the 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:
- the enclosing names
-
primitive
public boolean primitive()Functions the same asClass.isPrimitive()
.- Returns:
- the primitive
-
array
public boolean array()Functions the same asClass.isArray()
.- Returns:
- the array
-
generic
public boolean generic()Indicates whether this type is using generics.- Returns:
- the generic
-
wildcard
public boolean wildcard()Indicates whether this type is using wildcard generics.- Returns:
- the wildcard
-
typeArguments
Returns the list of generic type arguments, or an empty list if no generics are in use.- Returns:
- the type arguments
- See Also:
-
typeParameters
Deprecated, for removal: This API element is subject to removal in a future version.theTypeNameBlueprint.typeArguments()
will contain all required informationType 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:
- the type parameters
-
lowerBounds
Generic types that provide keywordextends
will 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:
- the lower bounds
- See Also:
-
upperBounds
Generic types that provide keywordsuper
will 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:
- the upper bounds
- See Also:
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-
TypeNameBlueprint.typeArguments()
will contain all required information