Class DefaultMediaModelUniqueIdentifierConverter
- java.lang.Object
-
- de.hybris.platform.cmsfacades.uniqueidentifier.functions.DefaultMediaModelUniqueIdentifierConverter
-
- All Implemented Interfaces:
UniqueIdentifierConverter<MediaModel>
public class DefaultMediaModelUniqueIdentifierConverter extends java.lang.Object implements UniqueIdentifierConverter<MediaModel>
Default implementation for consuming the item Id, name and itemType from readingMediaModel
class
-
-
Constructor Summary
Constructors Constructor Description DefaultMediaModelUniqueIdentifierConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaModel
convert(ItemData itemData)
ItemData
convert(MediaModel mediaModel)
Convert an ItemModel object to the correspondingItemData
instance.protected CatalogVersionService
getCatalogVersionService()
protected org.springframework.beans.factory.ObjectFactory<ItemData>
getItemDataDataFactory()
java.lang.String
getItemType()
Returns the item typeItemModel#getItemType
where the converter should be applied to.protected MediaService
getMediaService()
protected java.lang.String
getUniqueIdentifier(MediaModel mediaModel)
Returns the unique identifier using the encoded compose key class.void
setCatalogVersionService(CatalogVersionService catalogVersionService)
void
setItemDataDataFactory(org.springframework.beans.factory.ObjectFactory<ItemData> itemDataDataFactory)
void
setMediaService(MediaService mediaService)
-
-
-
Method Detail
-
getItemType
public java.lang.String getItemType()
Description copied from interface:UniqueIdentifierConverter
Returns the item typeItemModel#getItemType
where the converter should be applied to.- Specified by:
getItemType
in interfaceUniqueIdentifierConverter<MediaModel>
- Returns:
- item type
-
convert
public ItemData convert(MediaModel mediaModel)
Description copied from interface:UniqueIdentifierConverter
Convert an ItemModel object to the correspondingItemData
instance.- Specified by:
convert
in interfaceUniqueIdentifierConverter<MediaModel>
- Parameters:
mediaModel
- - the item model entity that will be converted.- Returns:
- an instance of the
ItemData
class that corresponds to the givenItemModel
UniqueIdentifierConverter.getItemType()
.
-
convert
public MediaModel convert(ItemData itemData)
Description copied from interface:UniqueIdentifierConverter
- Specified by:
convert
in interfaceUniqueIdentifierConverter<MediaModel>
- Parameters:
itemData
- - the item data instance that will be used in the conversion.- Returns:
- the
ItemModel
entity that corresponds to the givenItemData
UniqueIdentifierConverter.getItemType()
.
-
getUniqueIdentifier
protected java.lang.String getUniqueIdentifier(MediaModel mediaModel)
Returns the unique identifier using the encoded compose key class. See more details hereEncodedItemComposedKey
.- Parameters:
mediaModel
- the mediaitem model we want to extract the unique identifier.- Returns:
- the encoded unique identifier.
- See Also:
EncodedItemComposedKey
-
getItemDataDataFactory
protected org.springframework.beans.factory.ObjectFactory<ItemData> getItemDataDataFactory()
-
setItemDataDataFactory
public void setItemDataDataFactory(org.springframework.beans.factory.ObjectFactory<ItemData> itemDataDataFactory)
-
getMediaService
protected MediaService getMediaService()
-
setMediaService
public void setMediaService(MediaService mediaService)
-
getCatalogVersionService
protected CatalogVersionService getCatalogVersionService()
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
-