ChannelCache class Null safety
Cache for Channels
Properties
-
asMap
→ Map<
Snowflake, IChannel> -
Returns cache as Map
read-only, inherited
- count → int
-
Get number of elements from cache
read-only, inherited
- first → IChannel?
-
Get first element
read-only, inherited
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
-
keys
→ Iterable<
Snowflake> -
Returns key's values of cache
read-only, inherited
- last → IChannel
-
Get last element
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
-
values
→ Iterable<
IChannel> -
Returns values of cache
read-only, inherited
Methods
-
add(
Snowflake key, IChannel value) → void -
Add to cache
value
associated withkey
inherited -
addIfAbsent(
Snowflake key, IChannel item) → IChannel -
Puts
item
to collection ifkey
doesn't exist in cacheinherited -
addMap(
Map< Snowflake, IChannel> mp) → void -
Add Map to cache.
inherited
-
dispose(
) → Future< void> -
Perform cleanup
override
-
find(
bool predicate(IChannel item)) → Iterable< IChannel> -
Find matching items based of
predicate
inherited -
findOne(
bool predicate(IChannel item)) → IChannel? -
Find one element in cache
inherited
-
forEach(
void f(Snowflake, IChannel)) → void -
Loop over elements from cache
inherited
-
get<
E> (Snowflake id) → E? -
Allows to get channel and cast to
E
in one operation. -
hasKey(
Snowflake key) → bool -
Returns true if cache contains
key
inherited -
hasValue(
IChannel value) → bool -
Returns true if cache contains
value
inherited -
invalidate(
) → void -
Clear cache
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
remove(
Snowflake key) → void -
Remove
key
with associated with it valueinherited -
removeWhere(
bool predicate(Snowflake key, IChannel value)) → void -
Remove everything where
predicate
is trueinherited -
take(
int count) → Iterable< IChannel> -
Take
count
elements from cache. Returns Iterable of cache valuesinherited -
takeLast(
int count) → Iterable< IChannel> -
Takes
count
last elements from cache. Returns Iterable of cache valuesinherited -
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited
-
operator [](
Snowflake key) → IChannel? -
Returns element with key
key
inherited -
operator []=(
Snowflake key, IChannel item) → void -
Sets
item
forkey
inherited