MessageCache class

Cache for messages. Provides few utilities methods to facilitate interaction with messages. []= operator throws - use put() instead.

Inheritance

Properties

asMap Map<Snowflake, Message>
Returns cache as Map
no setterinherited
count int
Get number of elements from cache
no setterinherited
first Message
Get first element
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
keys Iterable<Snowflake>
Returns key's values of cache
no setterinherited
last Message
Get last element
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sorted List<Message>
Returns messages in chronological order
no setter
values Iterable<Message>
Returns values of cache
no setterinherited

Methods

add(Snowflake key, Message value) → void
Add to cache value associated with key
inherited
addIfAbsent(Snowflake key, Message item) Message
Puts item to collection if key doesn't exist in cache
inherited
addMap(Map<Snowflake, Message> mp) → void
Add Map to cache.
inherited
dispose() Future<void>
Perform cleanup
inherited
find(bool predicate(Message item)) Iterable<Message>
Find matching items based of predicate
inherited
findOne(bool predicate(Message item)) Message?
Find one element in cache
inherited
forEach(void f(Snowflake, Message)) → void
Loop over elements from cache
inherited
hasKey(Snowflake key) bool
Returns true if cache contains key
inherited
hasValue(Message value) bool
Returns true if cache contains value
inherited
invalidate() → void
Clear cache
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(Message message) Message
Allows to put message into cache
remove(Snowflake key) → void
Remove key with associated with it value
inherited
removeWhere(bool predicate(Snowflake key, Message value)) → void
Remove everything where predicate is true
inherited
take(int count) Iterable<Message>
Takes first count elements from cache. Returns Iterable of cache values
override
takeLast(int count) Iterable<Message>
Takes last count elements from cache. Returns Iterable of cache values
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](Snowflake key) Message?
Returns element with key key
inherited
operator []=(Snowflake key, Message item) → void
Unsupported
override