| Modifier and Type | Field and Description |
|---|---|
private List<Model> |
createBacklog
List of models that have unknown paths, occurs on create with commodities and transports.
|
private static org.slf4j.Logger |
logger
Logs actions performed by the class.
|
private Map<Path,Model> |
models
Map to all the
Models created by the SDK. |
| Modifier | Constructor and Description |
|---|---|
protected |
ModelRegistry()
Constructs a ModelRegistry object with an empty registry of
Models. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCreateBacklog(Model model)
Adds a
Model to the create backlog. |
protected Model |
findInCreateBacklog(JsonObject json,
ModelType type)
Finds a model in the create backlog.
|
protected Model |
getModel(Path path)
Returns the
Model associated with the specified path in the registry. |
protected boolean |
isModelRegistered(Path path)
Returns if a
Model has been registered with the specified path. |
protected void |
registerModel(Model model)
Adds a
Model to the registry. |
protected void |
removeCreateBacklog(Model model)
Removes a
Model from the create backlog. |
protected Model |
unregisterModel(Path path)
Removes a
Model from the registry. |
private static final org.slf4j.Logger logger
private final Map<Path,Model> models
Models created by the SDK. The keys are the string
version of paths.protected ModelRegistry()
Models.protected void registerModel(Model model)
Model to the registry.model - the model to be added to the registry.IllegalStateException - the path has already been used by another
model.IllegalArgumentException - if the model's path is unknown.protected Model unregisterModel(Path path)
Model from the registry.path - to the model.protected boolean isModelRegistered(Path path)
Model has been registered with the specified path.path - of the model to check.protected Model getModel(Path path)
Model associated with the specified path in the registry.path - to the model.protected void addCreateBacklog(Model model)
Model to the create backlog.model - to be added.protected void removeCreateBacklog(Model model)
Model from the create backlog.model - to be removed.protected Model findInCreateBacklog(JsonObject json, ModelType type)
json - of model to be found.type - of the model.