KClassValue

abstract class KClassValue<T : Any>

port of java.lang.ClassValue

Types

Link copied to clipboard

A backing map for all ClassValues. Gives a fully serialized "true state" for each pair (ClassValue cv, Class type). Also manages an unserialized fast-path cache.

Link copied to clipboard
object Companion
Link copied to clipboard

One binding of a value to a class via a ClassValue. States are:

Link copied to clipboard
class Identity

Private key for retrieval of this object from ClassValueMap.

Link copied to clipboard
class Version<T : Any>(classValue: KClassValue<T>)

Properties

Link copied to clipboard

Internal hash code for accessing Class.classValueMap.cacheArray.

Link copied to clipboard

This ClassValue's identity, expressed as an opaque object. The main object ClassValue.this is incorrect since subclasses may override ClassValue.equals, which could confuse keys in the ClassValueMap.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun get(type: KClass<*>): T

Returns the value for the given class. If no value has yet been computed, it is obtained by an invocation of the .computeValue method.

Link copied to clipboard

Check that e is non-null, matches this ClassValue, and is live.

Link copied to clipboard
fun put(type: KClass<*>, value: T)
Link copied to clipboard
fun remove(type: KClass<*>)

Removes the associated value for the given class. If this value is subsequently .get for the same class, its value will be reinitialized by invoking its .computeValue method. This may result in an additional invocation of the computeValue method for the given class.

Link copied to clipboard