# TypeOf

abstract class TypeOf<T>(source)

Provides a way to preserve high-fidelity Type information on generic types. Capture a generic type with an anonymous subclass. For example:

      new TypeOf<NamedDomainObjectContainer<ArtifactRepository>>() {}

Content copied to clipboard

#### Since

3.5

#### Parameters

<T>

Parameterized type

## Functions

equals
Link copied to clipboard
open fun equals(o: Any): Boolean
getActualTypeArguments
Link copied to clipboard
open fun getActualTypeArguments(): List<TypeOf<out Any>>
Returns the list of type arguments used in the construction of this parameterized type.
getComponentType
Link copied to clipboard
@Nullable
open fun getComponentType(): @Nullable TypeOf<out Any>
Returns the component type of the array type this object represents.
getConcreteClass
Link copied to clipboard
open fun getConcreteClass(): Class<T>
This returns the underlying, concrete Java java.lang.Class.
getFullyQualifiedName
Link copied to clipboard
open fun getFullyQualifiedName(): String
Fully Qualified name.
getLowerBound
Link copied to clipboard
@Nullable
open fun getLowerBound(): @Nullable TypeOf<out Any>
Returns the first declared lower-bound of the wildcard type expression represented by this type.
getParameterizedTypeDefinition
Link copied to clipboard
open fun getParameterizedTypeDefinition(): TypeOf<out Any>
Returns an object that represents the type from which this parameterized type was constructed.
getSimpleName
Link copied to clipboard
open fun getSimpleName(): String
Simple name.
getUpperBound
Link copied to clipboard
@Nullable
open fun getUpperBound(): @Nullable TypeOf<out Any>
Returns the first declared upper-bound of the wildcard type expression represented by this type.
hashCode
Link copied to clipboard
open fun hashCode(): Int
isArray
Link copied to clipboard
open fun isArray(): Boolean
Queries whether this object represents an array, generic or otherwise.
isAssignableFrom
Link copied to clipboard
fun isAssignableFrom(type: Type): Boolean
fun isAssignableFrom(type: TypeOf<out Any>): Boolean
Is this type assignable from the given type?
isParameterized
Link copied to clipboard
open fun isParameterized(): Boolean
Queries whether this object represents a parameterized type.
isPublic
Link copied to clipboard
open fun isPublic(): Boolean
Queries whether the type represented by this object is public (isPublic).
isSimple
Link copied to clipboard
open fun isSimple(): Boolean
Queries whether this object represents a simple (non-composite) type, not an array and not a generic type.
isSynthetic
Link copied to clipboard
open fun isSynthetic(): Boolean
Queries whether this object represents a synthetic type as defined by isSynthetic.
isWildcard
Link copied to clipboard
open fun isWildcard(): Boolean
Queries whether this object represents a wildcard type expression, such as `?`, `? extends Number`, or `? super Integer`.
parameterizedTypeOf
Link copied to clipboard
open fun parameterizedTypeOf(parameterizedType: TypeOf<out Any>, typeArguments: Array<TypeOf<out Any>>): TypeOf<out Any>
Constructs a new parameterized type from a given parameterized type definition and an array of type arguments.
toString
Link copied to clipboard
fun toString(): String
typeOf
Link copied to clipboard
open fun <T> typeOf(type: Class<T>): TypeOf<T>
Creates an instance of TypeOf for the given Class.
open fun <T> typeOf(type: Type): TypeOf<T>
Creates an instance of TypeOf for the given Type.