java.lang.Object
io.helidon.codegen.classmodel.TypeArgument
- All Implemented Interfaces:
Prototype.Api,Annotated,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 TypeMethodDescriptionList of declared and known annotations for this element.booleanarray()Functions similar toClass.isArray().boxed()Return the boxed equivalent of this type.static TypeArgument.Builderbuilder()Return newTypeArgument.Builderinstance.Functions similar toClass.getSimpleName().intCompare with another type name.Component type of array.static TypeArgumentCreates a new instance from a generic type name.static TypeArgumentCreates newTypeArgumentinstance based on the provided token.Simple names of enclosing classes (if any exist).booleanbooleangeneric()Indicates whether this type is using generics.The base generic type name, stripped of anyTypeName.typeArguments().inthashCode()List of all inherited annotations for this element.Generic types that provide keywordextendswill have a lower bound defined.Functions similar toClass.getPackageName().booleanFunctions similar toClass.isPrimitive().token()Type argument token.toString()Returns the list of generic type arguments, or an empty list if no generics are in use.Type parameters associated with the type arguments.Generic types that provide keywordsuperwill have an upper bound defined.booleanvararg()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.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.common.types.Annotated
allAnnotations, annotation, findAnnotation, hasAnnotationMethods inherited from interface io.helidon.common.types.TypeName
classNameWithEnclosingNames, classNameWithTypes, declaredName, fqName, isList, isMap, isOptional, isSet, isSupplier, name, resolvedName, unboxed
-
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 anyTypeName.typeArguments(). This is equivalent to the type name represented byTypeName.name().- Specified by:
genericTypeNamein interfaceTypeName- Returns:
- based generic type name
-
token
Type argument token.- Returns:
- token value
-
packageName
Description copied from interface:TypeNameFunctions similar toClass.getPackageName().- Specified by:
packageNamein interfaceTypeName- Returns:
- the package name, never null
-
className
Description copied from interface:TypeNameFunctions similar toClass.getSimpleName(). -
enclosingNames
Description copied from interface:TypeNameSimple names of enclosing classes (if any exist). For example for typeio.helidon.example.Type$NestOne$NestTwo, this would return a list ofType, NestOne.- Specified by:
enclosingNamesin interfaceTypeName- Returns:
- enclosing classes simple names
-
primitive
public boolean primitive()Description copied from interface:TypeNameFunctions similar toClass.isPrimitive(). -
array
public boolean array()Description copied from interface:TypeNameFunctions similar toClass.isArray(). -
generic
public boolean generic()Description copied from interface:TypeNameIndicates whether this type is using generics. -
wildcard
public boolean wildcard()Description copied from interface:TypeNameIndicates whether this type is using wildcard generics. -
typeArguments
Description copied from interface:TypeNameReturns the list of generic type arguments, or an empty list if no generics are in use.- Specified by:
typeArgumentsin interfaceTypeName- Returns:
- the type arguments of this type, if this type supports generics/parameterized type
- See Also:
-
typeParameters
Description copied from interface:TypeNameType 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). ifTypeName.typeArguments()exist, this list MUST exist and have the same size and order (it maps the name to the type).- Specified by:
typeParametersin interfaceTypeName- Returns:
- type parameter names as declared on this type, or names that represent the
TypeName.typeArguments()
-
lowerBounds
Description copied from interface:TypeNameGeneric 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.
- Specified by:
lowerBoundsin interfaceTypeName- Returns:
- list of lower bounds of this type
- See Also:
-
upperBounds
Description copied from interface:TypeNameGeneric 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.
- Specified by:
upperBoundsin interfaceTypeName- Returns:
- list of upper bounds of this type
- See Also:
-
componentType
Description copied from interface:TypeNameComponent type of array.- Specified by:
componentTypein interfaceTypeName- Returns:
- component type of array
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
Description copied from interface:TypeNameCompare with another type name. First compares byTypeName.name(), than byTypeName.primitive(), and finally byTypeName.array().- Specified by:
compareToin interfaceComparable<TypeName>- Specified by:
compareToin interfaceTypeName- Parameters:
o- type name to compare to- Returns:
- comparison result
- See Also:
-
vararg
public boolean vararg()Description copied from interface:TypeNameIf 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). -
annotations
Description copied from interface:AnnotatedList 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).- Specified by:
annotationsin interfaceAnnotated- Returns:
- the list of annotations declared on this element
-
inheritedAnnotations
Description copied from interface:AnnotatedList 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
Annotated.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!
- Specified by:
inheritedAnnotationsin interfaceAnnotated- Returns:
- list of all meta annotations of this element
-