Types

class Types

Factory methods for types.

Functions

arrayOf
Link copied to clipboard
open fun arrayOf(componentType: Type): GenericArrayType
Returns an array type whose elements are all instances of componentType.
collectionElementType
Link copied to clipboard
open fun collectionElementType(context: Type, contextRawType: Class<out Any>): Type
Returns the element type of this collection type.
equals
Link copied to clipboard
open fun equals(@Nullable a: Type, @Nullable b: Type): Boolean
Returns true if a and b are equal.
generatedJsonAdapterName
Link copied to clipboard
open fun generatedJsonAdapterName(clazz: Class<out Any>): String
Resolves the generated JsonAdapter fully qualified class name for a given JsonClass-annotatedclazz.
open fun generatedJsonAdapterName(className: String): String
Resolves the generated JsonAdapter fully qualified class name for a given JsonClass-annotatedclassName.
getRawType
Link copied to clipboard
open fun getRawType(type: Type): Class<out Any>
newParameterizedType
Link copied to clipboard
open fun newParameterizedType(rawType: Type, typeArguments: Array<Type>): ParameterizedType
Returns a new parameterized type, applying typeArguments to rawType.
newParameterizedTypeWithOwner
Link copied to clipboard
open fun newParameterizedTypeWithOwner(ownerType: Type, rawType: Type, typeArguments: Array<Type>): ParameterizedType
Returns a new parameterized type, applying typeArguments to rawType.
nextAnnotations
Link copied to clipboard
open fun nextAnnotations(annotations: Set<out Annotation>, jsonQualifier: Class<out Annotation>): Set<out Annotation>
Checks if annotations contains jsonQualifier.
subtypeOf
Link copied to clipboard
open fun subtypeOf(bound: Type): WildcardType
Returns a type that represents an unknown type that extends bound.
supertypeOf
Link copied to clipboard
open fun supertypeOf(bound: Type): WildcardType
Returns a type that represents an unknown supertype of bound.