mverse/mmodel_registry library

Classes

DefaultMEntity
MModelRegistry
Contains all registered MBaseModel types to support deserialization. The registry reads the mtype property in the json object, and finds the appropriate factory method.

Properties

mmodelRegistry MModelRegistry
no setter

Functions

extractMverseType(Map<String, dynamic> map) String?
initializeMModelRegistry(MModelRegistry registry) → dynamic

Typedefs

MModelFactory<M extends MBaseModel> = M Function(dynamic json)
Given json, produces an MBaseModel of that type
MModelFactoryResolver<M extends MBaseModel> = MModelFactory<M>? Function(String type)
Given a string, returns a function that knows how to instantiate objects of that type
TypeExtractor = String? Function(Map<String, dynamic> json)
Attempts to determine the entity type