EntityHandler<O> class abstract

Base class to implement entities handlers.

Mixed-in types
Implementers

Constructors

EntityHandler(EntityHandlerProvider? provider, {Type? type, String? typeName})

Properties

hashCode int
The hash code for this object.
no setterinherited
jsonReviver JsonReviver
getter/setter pair
jsonToEncodable JsonToEncodable?
getter/setter pair
provider EntityHandlerProvider
The provider of EntityHandler instances for different Types.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type Type
The entity Type handled by this instance.
final
typeInfo TypeInfo
Returns type as a TypeInfo.
no setter
typeName String
The entity Type name handled by this instance.
final

Methods

allFieldsValids(O o) bool
buildFieldsNamesIndexes(List<String> fieldsNames) Map<String, int>
inherited
buildFieldsNamesLC(List<String> fieldsNames) List<String>
inherited
buildFieldsNamesSimple(List<String> fieldsNames) List<String>
inherited
canCastIterable(Iterable itr, Type type) bool
canCastIterableNullable(Iterable itr, Type type) bool
castIterable(Iterable itr, Type type) Iterable?
castIterableNullable(Iterable itr, Type type) Iterable?
castList(List list, Type type) List?
castListNullable(List list, Type type) List?
checkAllFieldsValues(O o) → void
checkFieldValue<V>(O o, String key, {V? value, bool nullValue = false}) → void
classifyIterableElements(Iterable<Object?> itr) IterableClassification
constructors([O? o]) Map<String, Map<String, TypeInfo>>?
The constructors of the Entity. If not implemented returns null.
copy(O obj) FutureOr<O?>
Creates a copy of obj.
createDefault() FutureOr<O?>
createFromMap(Map<String, dynamic> fields, {EntityProvider? entityProvider, EntityCache? entityCache, EntityHandlerProvider? entityHandlerProvider, EntityRepositoryProvider? entityRepositoryProvider, EntityResolutionRules? resolutionRules, JsonDecoder? jsonDecoder}) FutureOr<O>
Creates an entity O with fields.
createFromMapSync(Map<String, dynamic> fields, {EntityProvider? entityProvider, EntityCache? entityCache, EntityHandlerProvider? entityHandlerProvider, EntityRepositoryProvider? entityRepositoryProvider, EntityResolutionRules? resolutionRules, JsonDecoder? jsonDecoder}) → O
Synchronous version of createFromMap.
decodeJson<T>(String json) → T?
decodeObjectJson(String json) → O
decodeObjectListJson(String json) List<O>
encodeJson(dynamic o) String
encodeObjectJson(O o) String
encodeObjectListJson(Iterable<O> list) String
ensureRegistered() → void
equalsFieldValues(String field, Object? value1, Object? value2, [O? o]) bool
equalsValues(Object? value1, Object? value2) bool
fieldsEntityAnnotations() Map<String, List<EntityAnnotation>>
fieldsNames([O? o]) List<String>
fieldsNamesIndexes([O? o]) Map<String, int>
fieldsNamesLC([O? o]) List<String>
fieldsNamesSimple([O? o]) List<String>
fieldsTypes([O? o]) Map<String, TypeInfo>
fieldsWithEntityReference([O? o]) Map<String, TypeInfo>
fieldsWithEntityReferenceList([O? o]) Map<String, TypeInfo>
fieldsWithType(bool typeFilter(String fieldName, TypeInfo fieldType), [O? o]) Map<String, TypeInfo>
fieldsWithTypeAndAnnotations(bool typeFilter(String fieldName, TypeInfo fieldType, List<EntityAnnotation>? fieldAnnotations), [O? o]) Map<String, TypeInfo>
fieldsWithTypeEntity([O? o]) Map<String, TypeInfo>
fieldsWithTypeEntityOrReference([O? o]) Map<String, TypeInfo>
fieldsWithTypeList([O? o]) Map<String, TypeInfo>
fieldsWithTypeListEntity([O? o]) Map<String, TypeInfo>
fieldsWithTypeListEntityOrReference([O? o]) Map<String, TypeInfo>
fieldToLCKey(String key) String
inherited
fieldToSimpleKey(String key) String
inherited
getAllFieldsEntityAnnotations([O? o]) Map<String, List<EntityAnnotation>>?
getAllFieldsWithEntityAnnotation<T extends EntityAnnotation>([O? o, bool filter(T e)?]) Map<String, List<T>>
getContextEntityResolutionRules() EntityResolutionRules?
The current EntityResolutionRules of the current context.
inherited
getEntityHandler<T>({T? obj, Type? type, String? typeName, EntityHandler? knownEntityHandler}) EntityHandler<T>?
getEntityHandlerByType<T>(Type type, {EntityHandler? knownEntityHandler}) EntityHandler<T>?
getEntityRepository<T extends Object>({T? obj, Type? type, String? name, EntityHandlerProvider? entityHandlerProvider, EntityRepositoryProvider? entityRepositoryProvider}) EntityRepository<T>?
getEntityRepositoryByType<T extends Object>(Type type, {EntityHandlerProvider? entityHandlerProvider, EntityRepositoryProvider? entityRepositoryProvider}) EntityRepository<T>?
getEntityRepositoryByTypeInfo<T extends Object>(TypeInfo typeInfo, {EntityHandlerProvider? entityHandlerProvider, EntityRepositoryProvider? entityRepositoryProvider}) EntityRepository<T>?
getField<V>(O o, String key) → V?
getFieldEntityAnnotations(O? o, String key) List<EntityAnnotation>?
getFieldKeyInMap(String field, Map<String, Object?> map, {String? fieldLC, String? fieldSimple, Map<String, String>? mapLC, Map<String, String>? mapSimple}) String?
Returns a field key from map.
inherited
getFields(O o) Map<String, dynamic>
getFieldsEntityTypes([O? o]) Map<String, TypeInfo>
getFieldsEnumTypes([O? o]) Map<String, TypeInfo>
getFieldsKeysInMap(List<String> fields, Map<String, Object?> map, {String? fieldLC, String? fieldSimple, Map<String, String>? mapLC, Map<String, String>? mapSimple}) Map<String, String?>
Returns a Map of field keys from map.
inherited
getFieldsTypes([O? o]) Map<String, TypeInfo>
getFieldsValuesFromMap(List<String> fieldsNames, Map<String, Object?> map, {Map<String, int>? fieldsNamesIndexes, List<String>? fieldsNamesLC, List<String>? fieldsNamesSimple, bool includeAbsentFields = false, List<String>? returnMapUsedKeys}) Map<String, Object?>
Returns a Map with the fields values populated from the provided map.
inherited
getFieldType(O? o, String key) TypeInfo?
getFieldValueFromMap(String field, Map<String, Object?> map, {String? fieldLC, String? fieldSimple, Map<String, String>? mapLC, Map<String, String>? mapSimple}) Object?
Returns a field value from map.
inherited
getID<V>(O o) → V?
getIDFromMap<V>(Map<String, dynamic>? o) → V?
getIDs<V>(List<O> os) List<V?>
idFieldName([O? o]) String
idType([O? o]) Type
inspectObject(O? o) → void
instantiateFromMapImpl(Map<String, dynamic> fields, {JsonDecoder? jsonDecoder}) FutureOr<O?>
isEntityInstance(Object? o) bool
Returns true if o is an entity instance O.
isValidFieldValue<V>(O o, String key, {V? value, bool nullValue = false}) bool
normalizeID(Object? id, {O? obj}) Object?
normalizeIDs(Iterable? ids, {O? obj}) List?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyKnownEntityRepositoryProvider(EntityRepositoryProvider provider) → void
resolveEntityFieldValue(O o, String key, dynamic value, {EntityProvider? entityProvider, EntityCache? entityCache, EntityResolutionRules? resolutionRules}) FutureOr
resolveEntityResolutionRules(EntityResolutionRules? resolutionRules) EntityResolutionRulesResolved
Resolves the resolutionRules to apply. Merges with the current EntityResolutionRules context if needed.
inherited
resolveFieldsNamesAndValues(Map<String, dynamic> fields, {EntityProvider? entityProvider, EntityCache? entityCache, EntityHandlerProvider? entityHandlerProvider, EntityRepositoryProvider? entityRepositoryProvider, List<String>? returnFieldsUsedKeys, EntityResolutionRules? resolutionRules}) FutureOr<Map<String, Object?>>
resolveFieldsValues(Map<String, Object?> fields, {O? o, EntityProvider? entityProvider, EntityCache? entityCache, EntityHandlerProvider? entityHandlerProvider, EntityRepositoryProvider? entityRepositoryProvider, EntityResolutionRules? resolutionRules}) FutureOr<Map<String, Object?>>
resolveFieldValue(String fieldName, TypeInfo? fieldType, Object? value, {EntityProvider? entityProvider, EntityCache? entityCache, EntityHandlerProvider? entityHandlerProvider, EntityRepositoryProvider? entityRepositoryProvider, EntityResolutionRules? resolutionRules}) FutureOr<Object?>
resolveFiledName(List<String> fieldsNames, String fieldName, {Map<String, int>? fieldsNamesIndexes, List<String>? fieldsNamesLC, List<String>? fieldsNamesSimple, bool includeAbsentFields = false, List<String>? returnMapUsedKeys}) String?
Resolves fieldName to one that matches a fieldsNames element.
inherited
resolveID<V>(Object? value) → V?
resolveIDFromMap<V>(Map map) → V?
resolveIDs<V>(Object? value) List<V>
resolveValueByType<T>(TypeInfo? type, Object? value, {EntityProvider? entityProvider, EntityCache? entityCache, EntityHandlerProvider? entityHandlerProvider, EntityRepositoryProvider? entityRepositoryProvider, EntityResolutionRules? resolutionRules}) FutureOr<T?>
setField<V>(O o, String key, V? value, {bool log = true, EntityCache? entityCache}) → void
setFieldsFromMap(O o, Map<String, dynamic> fields, {EntityProvider? entityProvider, EntityCache? entityCache, EntityResolutionRules? resolutionRules}) FutureOr<O>
setFieldValueDynamic(O o, String key, dynamic value, {EntityProvider? entityProvider, EntityCache? entityCache, EntityResolutionRules? resolutionRules}) FutureOr
setID<V>(O o, V id) → void
toEntitiesByIdMap(Iterable<O> entities) Map<dynamic, O>
toEntitiesMapByIdMap(Iterable<Map<String, dynamic>> entities) Map<dynamic, Map<String, dynamic>>
toJson(dynamic o) → dynamic
toString() String
A string representation of this object.
inherited
trySetField<V>(O o, String key, V? value, {EntityCache? entityCache}) bool
validateAllFields(O o) Map<String, EntityFieldInvalid>?
validateFieldValue<V>(O o, String key, {V? value, bool nullValue = false}) EntityFieldInvalid?

Operators

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

Static Methods

equalsEntityReferenceBase(Object value1, Object value2) bool?
equalsValuesBasic(Object? value1, Object? value2, {EntityHandler? entityHandler}) bool
equalsValuesCollection(Object value1, Object value2, {EntityHandler? entityHandler}) bool?
equalsValuesDateTime(Object value1, Object value2) bool?
equalsValuesEntity(Object value1, Object value2, {EntityHandler? entityHandler}) bool?
equalsValuesEntityMap(Object value1, Object value2, {EntityHandler? entityHandler}) bool
equalsValuesEnum(Object value1, Object value2) bool?
equalsValuesPrimitive(Object value1, Object value2) bool?
equalsValuesTime(Object value1, Object value2) bool?
getEntityIDFrom(Object o, {EntityHandler? entityHandler}) Object?
graterThanOrEqualValue(Object? value1, Object? value2, {EntityHandler? entityHandler}) bool
graterThanValue(Object? value1, Object? value2, {EntityHandler? entityHandler}) bool
isBasicType<T>([Type? type]) bool
isPrimitiveType<T>([Type? type]) bool
isReflectedEnumType<T>([Type? type]) bool
isValidEntityType<T>([Type? type]) bool
lessThanOrEqualValue(Object? value1, Object? value2, {EntityHandler? entityHandler}) bool
lessThanValue(Object? value1, Object? value2, {EntityHandler? entityHandler}) bool
resolveEntityType<O>({O? obj, Type? type}) Type?
valueToDynamicNumber(Object? value, {DynamicNumber<DynamicNumber>? def}) → DynamicNumber<DynamicNumber>