Interface UniqueItemIdentifierService

  • All Known Implementing Classes:
    DefaultUniqueItemIdentifierService

    public interface UniqueItemIdentifierService
    Interface definition for getting unique identifiers of Item Models.
    • 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 the CMSItemModel.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)
        Method to get the ItemModel identified by the given 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 UnknownIdentifierException
        Method to get the model item by the given key UniqueItemIdentifierService.
        Parameters:
        key - the key of the item model
        classType - the class of the item model
        Returns:
        a model for provided key
        Throws:
        UnknownIdentifierException - if the model doesn't exist