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
Modifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
-
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).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<? extends String> typeParameters) Type parameters associated with the type arguments.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.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.Type parameters associated with the type arguments.typeParameters
(List<? extends String> typeParameters) Type parameters associated with the type arguments.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)- 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
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
- type parameter names as declared on this type, or names that represent thetypeArguments()
- 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
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:
- the type parameters
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-