BasicEntityObject<Domain extends BasicDomainObject<IntIdentifier>> class Null safety

Simplest of all entity's objects Entity that extends EntityObject with IntIdentifier and Converter

EXAMPLE: See BasicDomainObject for ParentDomain's example code.

  class ParentEntity extends BasicEntityObject<ParentDomain> {
      static final ParentConverter CONVERTER = ParentConverter();

      int id;
      String name;
      DateTime bornDay;

      ParentEntity.fromDomain(ParentDomain domain)
          : id = domain.id,
          name = domain.name,
          bornDay = domain.bornDay;

      //this is the one to use
      ParentEntity.build({required this.name, this.id = 0, DateTime? date})
          : bornDay = date ?? DateTime.now();

      @override
      ParentDomain toDomain() {
        return ParentDomain(id: id, name: name, bornDay: bornDay);
      }
  }
Inheritance
Mixed in types

Constructors

BasicEntityObject()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
id int
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

compareTo(BasicEntityObject<BasicDomainObject<IntIdentifier>> other) int
By default compare the two entities by it's id
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toDomain() → Domain
Convert the current entity to it's correspondent domain.
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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