Easy Collection
A collection can be created at runtime by defining the collection type in the Easy type manifest file easytypes.json
.
This documentation describes how the Easy Collection Types can be configured in your Easy Extension.
Defining an easy collection type
An easy collection type definition can be created in easytypes.json
manifest file. The manifest allows to define the following for an easy collection type:
Code of the easy collection type
Element type for the collection
Type of collection (set / list)
Localized name of easy collection type
For example: the blow definition defines an easy collection type of type set and element type Customer. This means that an instance of this collection would represent a set of customers.
Using an easy collection type in an easy item type
While defining the easy item type definition for the easy item type, the attribute (of type easy colelction type) definition must use the code of the easy collection type as the type of the attribute.
For example: the blow definition defines an easy item type CustomerRestriction that is extending Abstract restriction and an attribute as customers of type as Customers easy collection type. This means that the CustomerRestriction item holds a set of customers in the attribute customers.
Defining the model class for an item having an attribute of easy collection type
While defining the model class of an easy item type that has an attribute of type easy collection type, must ensure to define the gettter and setter of the attribute with return/argument type as defined in the easy collection type definition.
For example: The model class definition below defined the getter and setter for the property customers having the return/argument types as Set<CustomerModel>
Limitations with Easy Collection Types
While the Easy collection types can be defined at runtime, following points must be of the consideration while creating the Easy collection types:
Modification or Removal a collection type is not supported in Easy Extension Framework