EntityBase class base

An immutable base implementation of Entity.

As this class is defined with the class modifier base, the class can only be extended, but not implemented. When a subtype should be defined with implements, then such a subtype should implement Entity.

Implemented types
Annotations
  • @immutable

Constructors

EntityBase({Identifier? id, required DataObject properties})
A new entity of optional id and required properties.
const
EntityBase.decodeJson(String source)
A new entity from JSON Object containg an optional identifier in "id" and the required properties (JSON Object) in "properties".
factory
EntityBase.empty()
An empty entity with empty properties and without id.
factory
EntityBase.fromJson(Map<String, Object?> json)
A new entity from JSON Object containg an optional identifier in "id" and the required properties (JSON Object) in "properties".
factory
EntityBase.view({Object? id, required Map<String, Object?> properties})
A new entity of optional id and required source properties.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
id Identifier?
An optional id for this entity.
final
properties DataObject
The required properties for this entity, allowed to be empty.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

encodeJson({Object encodeTime(DateTime time)?}) String
Encodes this entity into a JSON string containing a JSON Object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object?>
Returns data as an encodable object compatible with json.encode().
override
toString() String
A string representation of this object.
override

Operators

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