interface MessageCache : MutableMap<Long, Message>
Cache for messages in order to get the old content in MESSAGE_UPDATE
and MESSAGE_DELETE
events.
See Also
open val entries: MutableSet<MutableEntry<Long, Message>> |
|
abstract val keys: MutableSet<Long>
A MutableSet of all cached ids. |
|
abstract val values: MutableCollection<Message>
A MutableSet of all cached messages |
open fun cacheMessage(message: Message): Message?
Adds a message to the cache. |
|
abstract fun clear(): Unit
Clears the cache |
|
abstract operator fun contains(id: Long): Boolean
Checks whether an id is cached or not. |
|
open fun containsKey(key: Long): Boolean |
|
open fun containsValue(value: Message): Nothing |
|
abstract operator fun get(key: Long): Message?
Gets a message from the cache. |
|
abstract fun isEmpty(): Boolean
Checks whether there is at least one message cached. |
|
open operator fun minusAssign(id: Long): Unit open operator fun minusAssign(message: Message): Unit |
|
open operator fun plusAssign(message: Message): Unit |
|
abstract fun put(key: Long, value: Message): Message?
Adds a message to the cache. |
|
open fun putAll(from: Map<out Long, Message>): Nothing |
|
abstract fun remove(key: Long): Message?
Removes a message by it's id from the cache. open fun remove(message: Message): Message?
Removes the message from the cache. |
fun activate(eventManager: EventManager): MessageCache
Creates a new Message cache and registers it's listner to the specified eventManager. |
class MemoryMessageCache : MessageCache |