Ko Type Declaration
Represents a Kotlin type declaration.
Properties
List of annotations.
The source type without generic type arguments and nullability ("?").
The parent of the declaration.
File containing the declaration.
Determines whatever declaration is a class or an interface.
Determines whatever declaration is a class, an interface or an object.
Determines whatever declaration is a class or an object.
Determines whatever declaration is an external. An external declaration refers to a declaration that is defined outside the project's codebase. for e.g. in external library.
Determines whatever source declaration is an external type. An external type refers to a type that is defined outside the project's codebase. for e.g. in external library.
Determines whatever declaration is a function.
Determines whatever type is function type.
Determines whatever type is generic type.
Determines whatever declaration is import alias.
Determines whatever declaration is an interface.
Determines whatever declaration is an interface or an object.
Determines whatever declaration is a Kotlin stdlib basic type Basic types
Determines whatever declaration is a Kotlin stdlib Collection type Collections overview.
Determines whatever declaration is a build in Kotlin type. It can be a basic Kotlin type Basic types or collection type Collections overview (https://kotlinlang.org/docs/collections-overview.html#collection).
Determines whether the declaration is a mutable type.
Determines whatever declaration type is nullable.
Determines whatever declaration is a property.
Determines whether the source declaration is a star projection. A star projection is a placeholder that represents any type in a generic context, allowing for flexible type constraints.
Determines whatever declaration is a type alias.
Determines whatever declaration is a type parameter.
Text of the declaration with the location (file path, line and column).
The declaration's module name.
The number of annotations.
The number of parameters for the function type.
The number of parameters for the function type.
The number of type arguments.
Package of the declaration.
Represents the parameters of the function type.
Represents the parameters of the function type.
Project file path of the declaration or root project path of the file.
Represents the return type of the function type.
Represents the source declaration associated with this type.
The declaration's source set name.
The source type. For val car:MyClass
it will be "MyClass". For val car:MyClass<String>
it will be "MyClass
A list of type arguments associated with this declaration, if any. If there are no type arguments, this returns null
.
Functions
Represents the class declaration associated with this declaration.
Represents the class or interface declaration associated with this declaration.
Represents the class, interface or object declaration associated with this declaration.
Represents the class or object declaration associated with this declaration.
Represents the external declaration associated with this declaration. An external type refers to a type that is defined outside the project's codebase. for e.g. in external library.
Represents the external declaration associated with this declaration. An external type refers to a type that is defined outside the project's codebase. for e.g. in external library.
Represents the function declaration associated with this declaration.
Represents the import alias declaration associated with this declaration.
Represents the interface declaration associated with this declaration.
Represents the interface or object declaration associated with this declaration.
Represents the Kotlin basic type declaration associated with this declaration.
Represents the Kotlin collection type declaration associated with this declaration.
Represents the Kotlin type declaration associated with this declaration.
Represents the object declaration associated with this declaration.
Represents the property declaration associated with this declaration.
Represents the declaration alias declaration associated with this declaration.
Represents the declaration parameter declaration associated with this declaration.
Returns the number of annotations that satisfies the specified predicate present in the declaration.
Counts the number of parameters that match the given predicate.
Counts the number of parameter types that match the given predicate.
Counts the number of type arguments that match the given predicate.
Determines whether the declaration has all annotations that satisfy the provided predicate.
Determines whether the declaration has annotations with all the specified KClass
type.
Checks if all parameters match the given predicate.
Checks if all parameter types match the given predicate.
Checks if all type arguments match the given predicate.
Checks if all type arguments match the specified class.
Determines whether the declaration has at least one annotation that satisfies the provided predicate.
Determines whether the declaration has at least one annotation of the specified KClass
type.
Returns true
if declaration represents the type of T.
Determines whatever declaration has any annotation.
Determines whether the declaration has annotations with all the specified names.
Determines whether the declaration has at least one annotation whose name matches any of the specified names.
Whether declaration has a specified class declaration.
Whether declaration has a class declaration of the specified Kotlin class.
Whether declaration has a specified class or interface declaration.
Whether declaration has a class or an interface declaration of the specified Kotlin class.
Whether declaration has a specified class, interface or object declaration.
Whether declaration has a class, an interface or an object declaration of the specified Kotlin class.
Whether declaration has a specified class or object declaration.
Whether declaration has a class or an object declaration of the specified Kotlin class.
Whether declaration has a specified external type declaration. An external type refers to a type that is defined outside the project's codebase. for e.g. in external library.
Whether declaration has a external type declaration of the specified Kotlin class. An external type refers to a type that is defined outside the project's codebase. for e.g. in external library.
Whether type has a specified external type declaration. An external type refers to a type that is defined outside the project's codebase. for e.g. in external library.
Whether type has a external type declaration of the specified Kotlin class. An external type refers to a type that is defined outside the project's codebase. for e.g. in external library.
Whether declaration has a specified function declaration.
Whether declaration has a function declaration of the specified Kotlin function.
Whether declaration has a specified import alias declaration.
Whether declaration has a specified interface declaration.
Whether declaration has an interface declaration of the specified Kotlin class.
Whether declaration has a specified interface or object declaration.
Whether declaration has an interface or an object declaration of the specified Kotlin class.
Whether declaration has a specified kotlin basic type declaration.
Whether declaration has a kotlin basic type declaration of the specified Kotlin class.
Whether declaration has a specified kotlin collection type declaration.
Whether declaration has a kotlin collection type declaration of the specified Kotlin class.
Whether declaration has a specified kotlin type declaration.
Whether declaration has a kotlin type declaration of the specified Kotlin class.
Name of the declaration containing text.
Name of the declaration with suffix.
Name of the declaration matching regex.
Name of the declaration with prefix.
Whether declaration has a specified object declaration.
Whether declaration has a object declaration of the specified Kotlin class.
Checks if any parameter matches the given predicate.
Checks if any parameter type matches the given predicate.
Whether declaration has a specified property declaration.
Whether declaration has a property declaration of the specified Kotlin property.
Checks if the return type matches the given predicate.
Checks if the return type matches the specified class.
Determines whatever type has a specified source declaration.
Whether type has a source declaration of the specified Kotlin class.
Text of the declaration containing text.
Text of the declaration with suffix.
Text of the declaration matching regex.
Text of the declaration with prefix.
Whether declaration has a specified type alias declaration.
Checks if any type argument matches the given predicate.
Checks if any type argument is of the specified class.
Determines whatever the declaration has type arguments.
Checks if all type arguments have one of the specified names.
Checks if any type argument has one of the specified names.
Whether declaration has a specified type parameter declaration.
Determines whatever declaration reside in module.
Determines whatever the declaration resides in a package.
Determines whatever declaration reside in file path or file reside in path.
Determines whatever declaration reside in source set.
Determines whatever the declaration resides outside a package.