Entity<Key extends EntityKey> class

Represents an entity with a unique identifier and timestamp.

Implementers

Constructors

Entity({String? id, int? timeMills})
Constructs an Entity object with optional id and timeMills.
Entity.from(dynamic source)
Constructs an Entity object from a dynamic source.
factory
Entity.root(dynamic source)
Constructs an Entity object from a dynamic source.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
The unique identifier of the entity.
getter/setter pair
idInt int
The unique identifier of the entity as an integer.
no setter
key → Key
The key associated with the entity.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source Map<String, dynamic>
Returns the entity as a map.
no setter
timeMills int
The timestamp associated with the entity.
getter/setter pair

Methods

isInsertable(String key, dynamic value) bool
makeKey() → Key
Constructs the key for the entity.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns a string representation of the source map.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

generateID String
Generates a unique identifier for the entity.
no setter
generateTimeMills int
Generates a timestamp for the entity.
no setter

Static Methods

autoId(dynamic source, [String? key]) String?
Extracts and returns the auto-generated ID from the source.
autoTimeMills(dynamic source, [String? key]) int?
Extracts and returns the auto-generated timestamp from the source.
object<T>(String key, dynamic source, EntityBuilder<T> builder) → T?
Returns an object associated with the given key from the source, constructed using the provided builder.
objects<T>(String key, dynamic source, EntityBuilder<T> builder) List<T>?
Returns a list of objects associated with the given key from the source, constructed using the provided builder.
type<T>(String key, dynamic source, EntityBuilder<T> builder) → T?
Returns an object associated with the given key from the source, constructed using the provided builder.
value<T>(String key, dynamic source) → T?
Returns the value associated with the given key from the source, cast to the specified type.
values<T>(String key, dynamic source) List<T>?
Returns a list of values associated with the given key from the source, cast to the specified type.