org.mapdb / Atomic / Var


class Var<E : Any>

Atomically updated variable which may contain any type of record.


<init> Var(store: Store, recid: Long, serializer: Serializer<E>)


compareAndSet fun compareAndSet(expect: E, update: E): Boolean

Atomically sets the value to the given updated value if the current value equals the expected value.

get fun get(): E

Returns the current value.

getAndSet fun getAndSet(newValue: E): E

Atomically sets to the given value and returns the previous value.

getRecid fun getRecid(): Long

set fun set(newValue: E): Unit

Unconditionally sets to the given value.

toString fun toString(): String