Class EntityModel

java.lang.Object
com.priint.pubserver.entity.EntityModel
All Implemented Interfaces:
Serializable

public class EntityModel extends Object implements Serializable
Class representing an entity model.

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 Details

    • EntityModel

      public EntityModel()
  • Method Details

    • getIdentifier

      public String getIdentifier()
      Get the identifier of the model.

      Must be unique within the client.

      Defaults to an empty string.

      Returns:
      identifier string
    • setIdentifier

      public void setIdentifier(String identifier)
      Set the identifier of the model.

      Must be unique within the client.

      Throws NullArgumentException if input is null.

      Parameters:
      identifier -
    • getTestCases

      public List<TestCase> getTestCases()
      Gets test cases.
      Returns:
      list of TestCase Defaults to an empty list.
    • setTestCases

      public void setTestCases(List<TestCase> testCases)
      Sets test cases.

      Throws NullArgumentException if input is null.

      Parameters:
      testCases - the test cases
    • addTestCase

      public void addTestCase(TestCase testCase)
      Add a case to the list of test cases.
      Parameters:
      testCase -
    • getLabel

      public String getLabel()
      Get the label of the entity model.

      Defaults to an empty string.

      Returns:
      label of this model
    • setLabel

      public void setLabel(String label)
      Set the label of the entity model.

      Throws NullArgumentException if input is null.

      Parameters:
      label -
    • getClient

      public Client getClient()
      Get the client associated with this entity model.

      Defaults to an empty client.

      Returns:
      Client
    • setClient

      public void setClient(Client client)
      Set the client associated with this entity model.

      Throws NullArgumentException if input is null.

      Parameters:
      client -
    • getConnectorOfEntityModels

      public List<ConnectorOfEntityModel> getConnectorOfEntityModels()
      Gets connector of entity models.
      Returns:
      a list of ConnectorOfEntityModel

      Defaults to an empty list.

    • setConnectorOfEntityModels

      public void setConnectorOfEntityModels(List<ConnectorOfEntityModel> connectorOfEntityModels)
      Sets connector of entity models.

      Throws NullArgumentException if input is null.

      Parameters:
      connectorOfEntityModels - the connectorOfEntityModels to set
    • addConnectorOfEntityModel

      public void addConnectorOfEntityModel(ConnectorOfEntityModel conmodel)
      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

      public Map<String,Entity> 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

      public void setEntities(Map<String,Entity> entities)
      Set the entities of this model.

      Throws NullArgumentException if input is null.

      Parameters:
      entities - the map of entities to set
    • addEntity

      public void addEntity(Entity entity)
      Add an entity to the list of entities.

      Throws NullArgumentException if input is null.

      Parameters:
      entity -
    • getEntity

      public <T extends Entity> T getEntity(String entityIdentifier, Class<T> entityClass)
      Get a entity by identifier and sub-class of entity.
      Type Parameters:
      T - the type parameter
      Parameters:
      entityIdentifier - the entity identifier
      entityClass - type of entity
      Returns:
      Entity from model or null if no entity with that identifier belongs to the model
    • getEntity

      public Entity getEntity(String entityIdentifier)
      Get a entity by identifier and sub-class of entity.
      Parameters:
      entityIdentifier - the entity identifier
      Returns:
      Entity from model or null if 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

      public String getDescription()
      Get the description of the model.

      Defaults to an empty string.

      Returns:
      the description
    • setDescription

      public void setDescription(String description)
      Set the description of the model.

      Throws NullArgumentException if input is null.

      Parameters:
      description - the description to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPluginConfigName

      public String getPluginConfigName()
      Get the name of this entity model to use in plug-in configuration.
      Returns:
      string containing plug-in configuration name
    • getPluginConfigPath

      public String getPluginConfigPath()
      Get the path of the entity's model to use in plug-in configurations.
      Returns:
      string containing repository path
    • toPluginConfig

      public PluginConfig toPluginConfig()
      Create a plug-in configuration for this entity model with all dependencies.
      Returns:
      plug -in configuration