Util

class Util

Types

Link copied to clipboard
class GenericArrayTypeImpl : GenericArrayType
Link copied to clipboard
class ParameterizedTypeImpl : ParameterizedType
Link copied to clipboard
class WildcardTypeImpl : WildcardType
The WildcardType interface supports multiple upper bounds and multiple lower bounds.

Functions

Link copied to clipboard
open fun <T> boxIfPrimitive(type: Class<T>): Class<T>
Link copied to clipboard
open fun canonicalize(type: Type): Type
Returns a type that is functionally equal but not necessarily equal according to Object.equals().
Link copied to clipboard
open fun generatedAdapter(    moshi: Moshi,     type: Type,     rawType: Class<out Any>): JsonAdapter<out Any>
Loads the generated JsonAdapter for classes annotated JsonClass.
Link copied to clipboard
open fun getGenericSupertype(    context: Type,     rawType: Class<out Any>,     toResolve: Class<out Any>): Type
Returns the generic supertype for supertype.
Link copied to clipboard
open fun hasNullable(annotations: Array<Annotation>): Boolean
Returns true if annotations has any annotation whose simple name is Nullable.
Link copied to clipboard
open fun isAnnotationPresent(annotations: Set<out Annotation>, annotationClass: Class<out Annotation>): Boolean
Link copied to clipboard
open fun isKotlin(targetClass: Class<out Any>): Boolean
Link copied to clipboard
open fun isPlatformType(rawType: Class<out Any>): Boolean
Returns true if rawType is built in.
Link copied to clipboard
open fun jsonAnnotations(annotations: Array<Annotation>): Set<out Annotation>
open fun jsonAnnotations(annotatedElement: AnnotatedElement): Set<out Annotation>
Link copied to clipboard
open fun jsonName(declaredName: String, @Nullable annotation: Json): String
open fun jsonName(declaredName: String, element: AnnotatedElement): String
Link copied to clipboard
open fun <T> lookupDefaultsConstructor(targetClass: Class<T>): Constructor<T>
Reflectively looks up the defaults constructor of a kotlin class.
Link copied to clipboard
open fun missingProperty(    propertyName: String,     jsonName: String,     reader: JsonReader): JsonDataException
Link copied to clipboard
open fun removeSubtypeWildcard(type: Type): Type
If type is a "?
Link copied to clipboard
open fun resolve(    context: Type,     contextRawType: Class<out Any>,     toResolve: Type): Type
Link copied to clipboard
open fun rethrowCause(e: InvocationTargetException): RuntimeException
Throws the cause of e, wrapping it if it is checked.
Link copied to clipboard
open fun typeAnnotatedWithAnnotations(type: Type, annotations: Set<out Annotation>): String
Link copied to clipboard
open fun typesMatch(pattern: Type, candidate: Type): Boolean
Link copied to clipboard
open fun unexpectedNull(    propertyName: String,     jsonName: String,     reader: JsonReader): JsonDataException

Properties

Link copied to clipboard
val DEFAULT_CONSTRUCTOR_MARKER: Class<out Any>
Link copied to clipboard
val EMPTY_TYPE_ARRAY: Array<Type>
Link copied to clipboard
val NO_ANNOTATIONS: Set<Annotation>