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

Functions

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

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

get fun get(mirror: WildcardType, typeVariables: MutableMap<TypeParameterElement, TypeVariableName> = mutableMapOf()): TypeName
fun get(wildcardName: WildcardType, map: MutableMap<Type, TypeVariableName> = mutableMapOf()): TypeName
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