Cacheable<T extends Snowflake, S extends SnowflakeEntity> class Null safety

Wraps SnowflakeEntity that can be taken from cache or optionally downloaded from API. Always provides id of entity. download() method tries to get entity from API and returns it upon success or throws Error if something happens in the process.

Implementers

Properties

hashCode int
The hash code for this object. [...]
read-only, override
id → T
Id of entity
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

download() Future<S>
Downloads entity from cache and caches result
getFromCache() → S?
Returns entity from cache or null if not present
getOrDownload() FutureOr<S>
Returns entity from cache or tries to download from API if not found. If downloading is successful it caches results
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
override