Class EntityModel
- All Implemented Interfaces:
Serializable
The model contains a list of entities building a hierarchy of buckets and optionally a net of associated buckets (via cords) together with content entities containing final data, like texts, images, prices etc.
Connectors can be attached to the model and the entities to connect to content systems.
- Since:
- 4.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a connector to the entity model.voidAdd an entity to the list of entities.voidaddTestCase(TestCase testCase) Add a case to the list of test cases.Get the client associated with this entity model.Gets connector of entity models.Get the description of the model.Returns the entities of this model.Get a entity by identifier and sub-class of entity.<T extends Entity>
TGet a entity by identifier and sub-class of entity.Get the identifier of the model.getLabel()Get the label of the entity model.Get the name of this entity model to use in plug-in configuration.Get the path of the entity's model to use in plug-in configurations.Gets test cases.booleanGet if entity model is visible to other modules than entity manager.booleanIs test mode boolean.voidSet the client associated with this entity model.voidsetConnectorOfEntityModels(List<ConnectorOfEntityModel> connectorOfEntityModels) Sets connector of entity models.voidsetDescription(String description) Set the description of the model.voidsetEntities(Map<String, Entity> entities) Set the entities of this model.voidsetIdentifier(String identifier) Set the identifier of the model.voidSet the label of the entity model.voidsetPublicModel(boolean publicModel) Set if entity model is visible to other modules than entity manager.voidsetTestCases(List<TestCase> testCases) Sets test cases.voidsetTestMode(boolean testMode) Sets test mode.Create a plug-in configuration for this entity model with all dependencies.toString()
-
Constructor Details
-
EntityModel
public EntityModel()
-
-
Method Details
-
getIdentifier
Get the identifier of the model.Must be unique within the client.
Defaults to an empty string.
- Returns:
- identifier string
-
setIdentifier
Set the identifier of the model.Must be unique within the client.
Throws NullArgumentException if input is
null.- Parameters:
identifier-
-
getTestCases
Gets test cases.- Returns:
- list of
TestCaseDefaults to an empty list.
-
setTestCases
Sets test cases.Throws NullArgumentException if input is
null.- Parameters:
testCases- the test cases
-
addTestCase
Add a case to the list of test cases.- Parameters:
testCase-
-
getLabel
Get the label of the entity model.Defaults to an empty string.
- Returns:
- label of this model
-
setLabel
Set the label of the entity model.Throws NullArgumentException if input is
null.- Parameters:
label-
-
getClient
Get the client associated with this entity model.Defaults to an empty client.
- Returns:
Client
-
setClient
Set the client associated with this entity model.Throws NullArgumentException if input is
null.- Parameters:
client-
-
getConnectorOfEntityModels
Gets connector of entity models.- Returns:
- a list of
ConnectorOfEntityModelDefaults to an empty list.
-
setConnectorOfEntityModels
Sets connector of entity models.Throws NullArgumentException if input is
null.- Parameters:
connectorOfEntityModels- the connectorOfEntityModels to set
-
addConnectorOfEntityModel
Add a connector to the entity model.- Parameters:
conmodel-
-
isTestMode
public boolean isTestMode()Is test mode boolean.- Returns:
- true if it is a test
Defaults to
false.
-
setTestMode
public void setTestMode(boolean testMode) Sets test mode.- Parameters:
testMode-
-
getEntities
Returns the entities of this model. The keys are NOT the identifiers or labels of the entities, but set internally by this class.Defaults to empty map.
- Returns:
- the entities
-
setEntities
Set the entities of this model.Throws NullArgumentException if input is
null.- Parameters:
entities- the map of entities to set
-
addEntity
Add an entity to the list of entities.Throws NullArgumentException if input is
null.- Parameters:
entity-
-
getEntity
Get a entity by identifier and sub-class of entity.- Type Parameters:
T- the type parameter- Parameters:
entityIdentifier- the entity identifierentityClass- type of entity- Returns:
- Entity from model or
nullif no entity with that identifier belongs to the model
-
getEntity
Get a entity by identifier and sub-class of entity.- Parameters:
entityIdentifier- the entity identifier- Returns:
- Entity from model or
nullif no entity with that identifier belongs to the model
-
isPublicModel
public boolean isPublicModel()Get if entity model is visible to other modules than entity manager.Defaults to
false.- Returns:
- true if entity model is visible to other modules than entity manager.
-
setPublicModel
public void setPublicModel(boolean publicModel) Set if entity model is visible to other modules than entity manager.- Parameters:
publicModel- the public model
-
getDescription
Get the description of the model.Defaults to an empty string.
- Returns:
- the description
-
setDescription
Set the description of the model.Throws NullArgumentException if input is
null.- Parameters:
description- the description to set
-
toString
-
getPluginConfigName
Get the name of this entity model to use in plug-in configuration.- Returns:
- string containing plug-in configuration name
-
getPluginConfigPath
Get the path of the entity's model to use in plug-in configurations.- Returns:
- string containing repository path
-
toPluginConfig
Create a plug-in configuration for this entity model with all dependencies.- Returns:
- plug -in configuration
-