Interface UniqueItemIdentifierService
-
- All Known Implementing Classes:
DefaultUniqueItemIdentifierService
public interface UniqueItemIdentifierServiceInterface definition for getting unique identifiers of Item Models.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<ItemData>getItemData(ItemModel itemModel)Method to get the unique identifier and other information (not the PK) about an Item Model.java.util.Optional<ItemModel>getItemModel(ItemData itemData)<T> java.util.Optional<T>getItemModel(java.lang.String key, java.lang.Class<T> classType)Method to get the model item by the given keyUniqueItemIdentifierService.
-
-
-
Method Detail
-
getItemData
java.util.Optional<ItemData> getItemData(ItemModel itemModel)
Method to get the unique identifier and other information (not the PK) about an Item Model. For CMS Items, that means getting theCMSItemModel.getUid()and name, but for other Items, this could be different.- Parameters:
itemModel- the item model used to get the unique identifier.- Returns:
- an item data object that contains the item's unique identifier and any other information
-
getItemModel
java.util.Optional<ItemModel> getItemModel(ItemData itemData)
- Parameters:
itemData- the container of item unique identifier and its type- Returns:
- the item model
-
getItemModel
<T> java.util.Optional<T> getItemModel(java.lang.String key, java.lang.Class<T> classType) throws UnknownIdentifierExceptionMethod to get the model item by the given keyUniqueItemIdentifierService.- Parameters:
key- the key of the item modelclassType- the class of the item model- Returns:
- a model for provided key
- Throws:
UnknownIdentifierException- if the model doesn't exist
-
-