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
- Object
- EntityObject
- BasicEntityObject
- Mixed in types
- IntIdentifier
- Converter<
Domain> - Comparable<
BasicEntityObject< Domain> >
Constructors
Properties
Methods
-
compareTo(
BasicEntityObject< BasicDomainObject< other) → intIntIdentifier> > -
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