CurrentSession

interface CurrentSession

Represents a container for all session instances

Functions

Link copied to clipboard
abstract fun clear(name: String)

Clear session instance for name

Link copied to clipboard
abstract fun findName(type: KClass<*>): String

Find session name for the specified type or fail if not found

Link copied to clipboard
abstract fun get(name: String): Any?

Get session instance for name

Link copied to clipboard
abstract fun set(name: String, value: Any?)

Set new session instance with name

Extensions

Link copied to clipboard
inline fun <T> CurrentSession.clear()

Clear session instance with type T

Link copied to clipboard
inline fun <T> CurrentSession.get(): T?

Get session instance with type T

Link copied to clipboard
inline fun <T> CurrentSession.getOrSet(name: String = findName(T::class), generator: () -> T): T

Get or generate a new session instance using generator with type T (or name if specified)

Link copied to clipboard
inline fun <T> CurrentSession.set(value: T?)

Set session instance with type T