kotlinpoet / com.squareup.kotlinpoet / WildcardTypeName

WildcardTypeName

class WildcardTypeName : TypeName

Properties

inTypes

val inTypes: List<TypeName>

outTypes

val outTypes: List<TypeName>

Inherited Properties

annotations

val annotations: List<AnnotationSpec>

isAnnotated

val isAnnotated: Boolean

isNullable

val isNullable: Boolean

Functions

copy

fun copy(nullable: Boolean, annotations: List<AnnotationSpec>): WildcardTypeName

Inherited Functions

equals

open fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Companion Object Functions

consumerOf

fun consumerOf(inType: TypeName): WildcardTypeName

Returns a type that represents an unknown type that consumes inType. For example, if inType is String, this returns in String.

fun consumerOf(inType: Type): WildcardTypeName
fun consumerOf(inType: KClass<*>): WildcardTypeName

producerOf

fun producerOf(outType: TypeName): WildcardTypeName

Returns a type that represents an unknown type that produces outType. For example, if outType is CharSequence, this returns out CharSequence. If outType is Any?, this returns *, which is shorthand for out Any?.

fun producerOf(outType: Type): WildcardTypeName
fun producerOf(outType: KClass<*>): WildcardTypeName

Extension Functions

jvmSuppressWildcards

fun TypeName.jvmSuppressWildcards(suppress: Boolean = true): TypeName

jvmWildcard

fun TypeName.jvmWildcard(): TypeName