Entity class abstract interface

An interface for an entity with an optional id and required properties (as a data object).

As this class is defined with the class modifier interface, the class can only be implemented, but not extended. This class also provides factory methods constructing instances of the default implementation provided by EntityBase.

Implementers

Constructors

Entity.decodeJson(String source)
A new entity from JSON Object containg an optional identifier in "id" and the required properties (JSON Object) in "properties".
factory
Entity.empty()
An empty entity with empty properties and without id.
factory
Entity.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
Entity.of({Identifier? id, required DataObject properties})
A new entity of an optional id and required properties.
factory
Entity.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 setterinherited
id Identifier?
An optional id for this entity.
no setter
properties DataObject
The required properties for this entity, allowed to be empty.
no setter
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.
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().
toString() String
A string representation of this object.
inherited

Operators

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