MessageCache class
Cache for messages. Provides few utilities methods to facilitate interaction with messages. []= operator throws - use put() instead.
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 withkey
inherited -
addIfAbsent(
Snowflake key, Message item) → Message -
Puts
item
to collection ifkey
doesn't exist in cacheinherited -
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 valueinherited -
removeWhere(
bool predicate(Snowflake key, Message value)) → void -
Remove everything where
predicate
is trueinherited -
take(
int count) → Iterable< Message> -
Takes first
count
elements from cache. Returns Iterable of cache valuesoverride -
takeLast(
int count) → Iterable< Message> -
Takes last
count
elements from cache. Returns Iterable of cache valuesoverride -
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