kotlinpoet / com.squareup.kotlinpoet / WildcardTypeName

WildcardTypeName

class WildcardTypeName : TypeName

Properties

lowerBounds

val lowerBounds: List<TypeName>

upperBounds

val upperBounds: List<TypeName>

Inherited Properties

annotations

val annotations: List<AnnotationSpec>

isAnnotated

val isAnnotated: Boolean

nullable

val nullable: Boolean

Functions

annotated

fun annotated(annotations: List<AnnotationSpec>): WildcardTypeName

asNonNullable

fun asNonNullable(): WildcardTypeName

asNullable

fun asNullable(): WildcardTypeName

withoutAnnotations

fun withoutAnnotations(): WildcardTypeName

Inherited Functions

annotated

fun annotated(vararg annotations: AnnotationSpec): TypeName

equals

open fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Companion Object Functions

subtypeOf

fun subtypeOf(upperBound: TypeName): WildcardTypeName

Returns a type that represents an unknown type that extends bound. For example, if bound is CharSequence.class, this returns ? extends CharSequence. If bound is Object.class, this returns ?, which is shorthand for ? extends Object.

fun subtypeOf(upperBound: Type): WildcardTypeName
fun subtypeOf(upperBound: KClass<*>): WildcardTypeName

supertypeOf

fun supertypeOf(lowerBound: TypeName): WildcardTypeName

Returns a type that represents an unknown supertype of bound. For example, if bound is String.class, this returns ? super String.

fun supertypeOf(lowerBound: Type): WildcardTypeName
fun supertypeOf(lowerBound: KClass<*>): WildcardTypeName