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 {@code 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 {@code a} and {@code 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-annotated{@code clazz}.
open fun generatedJsonAdapterName(className: String): String
Resolves the generated JsonAdapter fully qualified class name for a given JsonClass-annotated{@code className}.
getFieldJsonQualifierAnnotations
Link copied to clipboard
open fun getFieldJsonQualifierAnnotations(clazz: Class<out Any>, fieldName: String): Set<out Annotation>
the target class to read the {@code fieldName} field annotations from.
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 {@code typeArguments} to {@code rawType}.
newParameterizedTypeWithOwner
Link copied to clipboard
open fun newParameterizedTypeWithOwner(ownerType: Type, rawType: Type, typeArguments: Array<Type>): ParameterizedType
Returns a new parameterized type, applying {@code typeArguments} to {@code rawType}.
nextAnnotations
Link copied to clipboard
open fun nextAnnotations(annotations: Set<out Annotation>, jsonQualifier: Class<out Annotation>): Set<out Annotation>
Checks if {@code annotations} contains {@code jsonQualifier}.
subtypeOf
Link copied to clipboard
open fun subtypeOf(bound: Type): WildcardType
Returns a type that represents an unknown type that extends {@code bound}.
supertypeOf
Link copied to clipboard
open fun supertypeOf(bound: Type): WildcardType
Returns a type that represents an unknown supertype of {@code bound}.