Class TypeArgument
java.lang.Object
io.helidon.codegen.classmodel.TypeArgument
- All Implemented Interfaces:
Prototype.Api, Annotated, TypeName, Comparable<TypeName>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface TypeName
TypeName.BuilderBase<BUILDER, PROTOTYPE>Modifier and TypeInterfaceDescriptionstatic classTypeName.BuilderBase<BUILDER extends TypeName.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TypeName>Fluent API builder base forTypeName. -
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 interface Annotated
allAnnotations, annotation, findAnnotation, hasAnnotationModifier and TypeMethodDescriptiondefault List<Annotation> List of all annotations - bothAnnotated.annotations()andAnnotated.inheritedAnnotations().default Annotationannotation(TypeName annotationType) Get an annotation on this annotated type.default Optional<Annotation> findAnnotation(TypeName annotationType) Find an annotation on this annotated type.default booleanhasAnnotation(TypeName annotationType) Check if the annotation exists on this annotated.Methods inherited from interface TypeName
classNameWithEnclosingNames, classNameWithTypes, declaredName, fqName, isList, isMap, isOptional, isSet, isSupplier, name, resolvedName, unboxedModifier and TypeMethodDescriptiondefault StringClass name with enclosing types, separated by..default StringSimple class name with generic declaration (if part of this name).default StringTypically used as part of code-gen, when ".class" is tacked onto the suffix of what this returns.default StringfqName()The fully qualified type name.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.default StringThe fully resolved type.default TypeNameunboxed()Return the unboxed equivalent of this type.
-
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
-
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
-
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
-
wildcard
-
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
-
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
-