Class EntityModel

  • All Implemented Interfaces:
    java.io.Serializable

    public class EntityModel
    extends java.lang.Object
    implements java.io.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:
    Serialized Form
    • Constructor Detail

      • EntityModel

        public EntityModel()
    • Method Detail

      • getIdentifier

        public java.lang.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​(java.lang.String identifier)
        Set the identifier of the model.

        Must be unique within the client.

        Throws NullArgumentException if input is null.

        Parameters:
        identifier -
      • getTestCases

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

        public void setTestCases​(java.util.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 java.lang.String getLabel()
        Get the label of the entity model.

        Defaults to an empty string.

        Returns:
        label of this model
      • setLabel

        public void setLabel​(java.lang.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 -
      • setConnectorOfEntityModels

        public void setConnectorOfEntityModels​(java.util.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 java.util.Map<java.lang.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​(java.util.Map<java.lang.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​(java.lang.String entityIdentifier,
                                              java.lang.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​(java.lang.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 java.lang.String getDescription()
        Get the description of the model.

        Defaults to an empty string.

        Returns:
        the description
      • setDescription

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

        Throws NullArgumentException if input is null.

        Parameters:
        description - the description to set
      • toString

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

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

        public java.lang.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