Interface DynamicEntity
- All Superinterfaces:
IdentifiedObject
- All Known Implementing Classes:
DynamicCategory
,DynamicProduct
,DynamicVariant
The
DynamicEntity
interface represents a dynamic, attribute-driven platform entity
that is uniquely identifiable. It extends IdentifiedObject
to support unique
identification and provides the ability to manage flexible key-value pairs (attributes)
at runtime. This makes it a versatile extension to complement predefined static data entities.
Important Note:
While DynamicEntity
can act as a generic supplementary container alongside
predefined entities (e.g., for use in situations requiring runtime custom attributes),
it is not recommended to use it as the primary defining entity in
the system. Instead, it should be leveraged for secondary use cases or as a tool for
extending predefined data entities.
This interface is useful in scenarios where specific business requirements demand support for dynamically configurable attributes that are not part of the core domain logic.
- Since:
- 1.0
- Author:
- Viktor Tovstyi
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the dynamic attributes of the entity.void
setAttributes
(Map<String, Object> attributes) Sets the dynamic attributes for the entity.Methods inherited from interface org.machanism.macha.core.entities.base.identifier.IdentifiedObject
getId, getKey
-
Method Details
-
getAttributes
Retrieves the dynamic attributes of the entity. Attributes are stored as key-value pairs in aMap
, where the key is aString
representing the attribute name and the value is anObject
. These attributes act as supplementary data for predefined entities.- Returns:
- a
Map
containing the entity's custom attributes
-
setAttributes
Sets the dynamic attributes for the entity. Attributes are added as key-value pairs, where the key is aString
and the value is anObject
.Note: These attributes are not recommended to replace core static properties but instead complement the structured data models.
- Parameters:
attributes
- theMap
containing key-value pairs to be set as attributes
-