GeneralConverter<Domain extends BasicDomainObject<IntIdentifier> , Entity extends BasicEntityObject> class
abstract
General converter entity <==> domain, it generalize and extract the conversion entity => domain & domain => entity in a single isolated class
Default implementation of GeneralConverter
EXAMPLE: See BasicEntityObject for ParentEntity's example code See BasicDomainObject for ParentDomain's example code
class ParentConverter
extends DefaultGeneralConverter<ParentDomain, ParentEntity> {
@override
ParentDomain toDomain(ParentEntity entity) {
return ParentDomain(
name: entity.name, bornDay: entity.bornDay, id: entity.id);
}
@override
ParentEntity toEntity(ParentDomain domain) {
return ParentEntity(domain.name, domain.bornDay, id: domain.id);
}
}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDomain(
Entity entity) → Domain - Convert entity into domain.
-
toDomainAll(
List< Entity> entities) → List<Domain> - Convert a list of entities into a list of domain. By default converting one by one into a new list using the single toDomain(entity) converter.
-
toEntity(
Domain domain) → Entity - Convert domain into entity.
-
toEntityAll(
List< Domain> domains) → List<Entity> - Convert a list of domain into a list of entities. By default converting one by one into a new list using the single toEntity(domain) converter.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited