abstract class TypeName
Any type in Kotlin's type system. This class identifies simple types like Int and String,
nullable types like Int?, composite types like Array<String> and Set<String>, and
unassignable types like Unit.
Type names are dumb identifiers only and do not model the values they name. For example, the
type name for kotlin.List doesn't know about the size() function, the fact that lists are
collections, or even that it accepts a single type parameter.
Instances of this class are immutable value objects that implement equals() and hashCode()
properly.
In an annotation processor you can get a type name instance for a type mirror by calling TypeName.get. In reflection code, you can use TypeName.get.
Defining new typesCreate new reference types like com.example.HelloWorld with ClassName.get. To build composite
types like Set<Long>, use the factory methods on ParameterizedTypeName, TypeVariableName,
and WildcardTypeName.
| annotations |
val annotations: List<AnnotationSpec> |
| isAnnotated |
val isAnnotated: Boolean |
| annotated |
fun annotated(vararg annotations: AnnotationSpec): TypeNameabstract fun annotated(annotations: List<AnnotationSpec>): TypeName |
| equals |
open fun equals(other: Any?): Boolean |
| hashCode |
open fun hashCode(): Int |
| toString |
open fun toString(): String |
| withoutAnnotations |
abstract fun withoutAnnotations(): TypeName |
| arrayComponent |
fun arrayComponent(type: TypeName): TypeName?
Returns the array component of |
| get |
fun get(mirror: TypeMirror, typeVariables: MutableMap<TypeParameterElement, TypeVariableName> = mutableMapOf()): TypeName
Returns a type name equivalent to fun get(type: KClass<*>): TypeNamefun get(type: Type, map: MutableMap<Type, TypeVariableName> = mutableMapOf()): TypeName
Returns a type name equivalent to |
| ArrayTypeName |
class ArrayTypeName : TypeName |
| ClassName |
class ClassName : TypeName, Comparable<ClassName>
A fully-qualified class name for top-level and member classes. |
| ParameterizedTypeName |
class ParameterizedTypeName : TypeName |
| TypeVariableName |
class TypeVariableName : TypeName |
| WildcardTypeName |
class WildcardTypeName : TypeName |