# UserDataHolder

open class UserDataHolder

Class for storing transaction data that should remain available to the transaction scope even after the transaction is committed.

#### Inheritors

Transaction

## Constructors

UserDataHolder
Link copied to clipboard
constructor()

## Functions

getOrCreate
Link copied to clipboard
fun <T : Any> getOrCreate(key: Key<T>, init: () -> T): T

Returns the value for the specified key. If the key is not found, the init function is called, then its result is mapped to the key and returned.

getUserData
Link copied to clipboard
fun <T : Any> getUserData(key: Key<T>): T?

Returns the value to which the specified key is mapped, as a value of type T.

putUserData
Link copied to clipboard
fun <T : Any> putUserData(key: Key<T>, value: T)

Maps the specified key to the specified value.

removeUserData
Link copied to clipboard
fun <T : Any> removeUserData(key: Key<T>): Any?

Removes the specified key and its corresponding value.