java.lang.Object
io.helidon.codegen.classmodel.TypeArgument
- All Implemented Interfaces:
Prototype.Api,TypeName,Comparable<TypeName>
Generic type argument model.
-
Nested Class Summary
Nested ClassesNested 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 TypeMethodDescriptionbooleanarray()boxed()Return the boxed equivalent of this type.static TypeArgument.Builderbuilder()Return newTypeArgument.Builderinstance.default StringClass name with enclosing types, separated by..default StringSimple class name with generic declaration (if part of this name).intstatic TypeArgumentCreates a new instance from a generic type name.static TypeArgumentCreates newTypeArgumentinstance based on the provided token.default StringTypically used as part of code-gen, when ".class" is tacked onto the suffix of what this returns.booleandefault StringfqName()The fully qualified type name.booleangeneric()The base generic type name, stripped of anyTypeNameBlueprint.typeArguments().inthashCode()default booleanisList()Indicates whether this type is ajava.util.List.default booleanisMap()Indicates whether this type is ajava.util.Map.default booleanIndicates whether this type is ajava.util.Optional.default booleanisSet()Indicates whether this type is ajava.util.Set.default booleanIndicates whether this type is aSupplier.default Stringname()The base name that includes the package name concatenated with the class name.booleandefault StringThe fully resolved type.token()Type argument token.toString()booleanvararg()booleanwildcard()
-
Method Details
-
create
Creates newTypeArgumentinstance based on the provided token.- Parameters:
token- argument token- Returns:
- new argument instance
-
create
Creates a new instance from a generic type name.- Parameters:
typeName- type name to use- Returns:
- a new type argument
-
builder
Return newTypeArgument.Builderinstance.- Returns:
- new builder instance
-
boxed
Description copied from interface:TypeNameReturn the boxed equivalent of this type. If this is not a primitive type, returns this instance. -
genericTypeName
Description copied from interface:TypeNameThe base generic type name, stripped of anyTypeNameBlueprint.typeArguments(). This is equivalent to the type name represented byTypeNameBlueprint.name().- Specified by:
genericTypeNamein 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
-
lowerBounds
-
upperBounds
-
componentType
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<TypeName>
-
vararg
public boolean vararg() -
classNameWithEnclosingNames
Class name with enclosing types, separated by.. If we have an inner classBuilderof 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.
-