java.lang.Object
io.helidon.codegen.classmodel.TypeArgument
- All Implemented Interfaces:
Prototype.Api
,TypeName
,Comparable<TypeName>
Generic type argument model.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.common.types.TypeName
TypeName.BuilderBase<BUILDER extends TypeName.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends TypeName> -
Method Summary
Modifier and TypeMethodDescriptionboolean
array()
boxed()
Return the boxed equivalent of this type.static TypeArgument.Builder
builder()
Return newTypeArgument.Builder
instance.default String
Class name with enclosing types, separated by.
.default String
Simple class name with generic declaration (if part of this name).int
static TypeArgument
Creates newTypeArgument
instance based on the provided token.default String
Typically used as part of code-gen, when ".class" is tacked onto the suffix of what this returns.boolean
default String
fqName()
The fully qualified type name.boolean
generic()
The base generic type name, stripped of anyTypeNameBlueprint.typeArguments()
.int
hashCode()
default boolean
isList()
Indicates whether this type is ajava.util.List
.default boolean
isMap()
Indicates whether this type is ajava.util.Map
.default boolean
Indicates whether this type is ajava.util.Optional
.default boolean
isSet()
Indicates whether this type is ajava.util.Set
.default boolean
Indicates whether this type is aSupplier
.default String
name()
The base name that includes the package name concatenated with the class name.boolean
default String
The fully resolved type.token()
Type argument token.toString()
boolean
wildcard()
-
Method Details
-
create
Creates newTypeArgument
instance based on the provided token.- Parameters:
token
- argument token- Returns:
- new argument instance
-
builder
Return newTypeArgument.Builder
instance.- Returns:
- new builder instance
-
boxed
Description copied from interface:TypeName
Return the boxed equivalent of this type. If this is not a primitive type, returns this instance. -
genericTypeName
Description copied from interface:TypeName
The base generic type name, stripped of anyTypeNameBlueprint.typeArguments()
. This is equivalent to the type name represented byTypeNameBlueprint.name()
.- Specified by:
genericTypeName
in interfaceTypeName
- Returns:
- based generic type name
-
token
Type argument token.- Returns:
- token value
-
packageName
-
className
-
enclosingNames
-
primitive
public boolean primitive() -
array
public boolean array() -
generic
public boolean generic() -
wildcard
public boolean wildcard() -
typeArguments
-
typeParameters
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<TypeName>
-
classNameWithEnclosingNames
Class name with enclosing types, separated by.
. If we have an inner classBuilder
of classType
, this method would returnType.Builder
.- Returns:
- class name with enclosing types
-
isList
default boolean isList()Indicates whether this type is ajava.util.List
.- Returns:
- if this is a list
-
isSet
default boolean isSet()Indicates whether this type is ajava.util.Set
.- Returns:
- if this is a set
-
isMap
default boolean isMap()Indicates whether this type is ajava.util.Map
.- Returns:
- if this is a map
-
isOptional
default boolean isOptional()Indicates whether this type is ajava.util.Optional
.- Returns:
- if this is an optional
-
isSupplier
default boolean isSupplier()Indicates whether this type is aSupplier
.- Returns:
- if this is a supplier
-
classNameWithTypes
Simple class name with generic declaration (if part of this name).- Returns:
- class name with generics, such as
Consumer<java.lang.String>
, orConsumer<T>
-
name
The base name that includes the package name concatenated with the class name. Similar toType.getTypeName()
. Name contains possible enclosing types, separated by$
.- Returns:
- the base type name given the set package and class name, but not including the generics/parameterized types
-
declaredName
Typically used as part of code-gen, when ".class" is tacked onto the suffix of what this returns.- Returns:
- same as getName() unless the type is an array, and then will add "[]" to the return
-
fqName
The fully qualified type name.- Returns:
- the fully qualified name
-
resolvedName
The fully resolved type. This will include the generic portion of the declaration, as well as any array declaration, etc.- Returns:
- the fully qualified name which includes the use of generics/parameterized types, arrays, etc.
-