DeclaredTypeName

class DeclaredTypeName : TypeName, Comparable<DeclaredTypeName>

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

Constructors

DeclaredTypeName
Link copied to clipboard
fun DeclaredTypeName(moduleName: String, simpleName: String, vararg simpleNames: String)
Returns a type name created from the given parts.

Types

Companion
Link copied to clipboard
object Companion

Functions

compareTo
Link copied to clipboard
open operator override fun compareTo(other: DeclaredTypeName): Int
enclosingTypeName
Link copied to clipboard
fun enclosingTypeName(): DeclaredTypeName?
Returns the enclosing type, like Map for Map.Entry.
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
makeNonOptional
Link copied to clipboard
open fun makeNonOptional(): TypeName
makeOptional
Link copied to clipboard
open fun makeOptional(): ParameterizedTypeName
nestedType
Link copied to clipboard
fun nestedType(name: String): DeclaredTypeName
Returns a new DeclaredTypeName instance for the specified name as nested inside this type.
peerType
Link copied to clipboard
fun peerType(name: String): DeclaredTypeName
Returns a type that shares the same enclosing package or type.
topLevelTypeName
Link copied to clipboard
fun topLevelTypeName(): DeclaredTypeName
Returns the top type in this nesting group.
toString
Link copied to clipboard
open override fun toString(): String
unwrapOptional
Link copied to clipboard
open fun unwrapOptional(): TypeName
wrapOptional
Link copied to clipboard
open fun wrapOptional(): ParameterizedTypeName

Properties

canonicalName
Link copied to clipboard
val canonicalName: String
compoundName
Link copied to clipboard
val compoundName: String
moduleName
Link copied to clipboard
val moduleName: String
Module name, like "Swift" for Array.Iterator.
name
Link copied to clipboard
open val name: String
optional
Link copied to clipboard
open val optional: Boolean = false
simpleName
Link copied to clipboard
val simpleName: String
Simple name of this type, like "Iterator" for Swift.Array.Iterator.
simpleNames
Link copied to clipboard
val simpleNames: List<String>

Extensions

parameterizedBy
Link copied to clipboard
fun DeclaredTypeName.parameterizedBy(vararg typeArguments: TypeName): ParameterizedTypeName