DeclaredTypeName

A fully-qualified type name for top-level and member types.

Constructors

Link copied to clipboard
fun DeclaredTypeName(moduleName: String, simpleName: String, vararg simpleNames: String)

Returns a type name created from the given parts. For example, calling this with module name "Swift" and simple names "Array", "Iterator" yields Swift.Array.Iterator.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open operator override fun compareTo(other: DeclaredTypeName): Int
Link copied to clipboard
fun enclosingTypeName(alwaysQualify: Boolean = this.alwaysQualify): DeclaredTypeName?

Returns the enclosing type, like Map for Map.Entry. Returns null if this type is not nested in another type.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun nestedType(name: String, alwaysQualify: Boolean = this.alwaysQualify): DeclaredTypeName

Returns a new DeclaredTypeName instance for the specified name as nested inside this type.

fun nestedType(names: List<String>, alwaysQualify: Boolean = this.alwaysQualify): DeclaredTypeName

Returns a new DeclaredTypeName instance for the specified names as nested inside this type.

Link copied to clipboard
fun peerType(name: String, alwaysQualify: Boolean = this.alwaysQualify): DeclaredTypeName

Returns a type that shares the same enclosing package or type. If this type is enclosed by another type, this is equivalent to enclosingTypeName().nestedType(name). Otherwise it is equivalent to get(packageName(), name).

Link copied to clipboard
Link copied to clipboard
fun topLevelTypeName(alwaysQualify: Boolean = this.alwaysQualify): DeclaredTypeName

Returns the top type in this nesting group. Equivalent to chained calls to DeclaredTypeName.enclosingTypeName until the result's enclosing type is null.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
val alwaysQualify: Boolean = false
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val implicit: Boolean = false
Link copied to clipboard

Module name, like "Swift" for Array.Iterator.

Link copied to clipboard
open val name: String
Link copied to clipboard
open val optional: Boolean = false
Link copied to clipboard

Simple name of this type, like "Iterator" for Swift.Array.Iterator.

Link copied to clipboard

Extensions

Link copied to clipboard