Class CMSItemNameExistsPredicate
- java.lang.Object
-
- de.hybris.platform.cmsfacades.cmsitems.predicates.CMSItemNameExistsPredicate
-
- All Implemented Interfaces:
java.util.function.Predicate<CMSItemModel>
public class CMSItemNameExistsPredicate extends java.lang.Object implements java.util.function.Predicate<CMSItemModel>
Predicate to test if a given cms item name maps to an existing cms item.Returns TRUE if the cms item exists; FALSE otherwise.
-
-
Constructor Summary
Constructors Constructor Description CMSItemNameExistsPredicate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringfindAbstractParentTypeCode(CMSItemModel cmsItemModel)Find the abstract parent typecode for a given item modelprotected java.util.List<CMSItemModel>findCMSItemByTypeCodeAndName(java.lang.String name, java.lang.String typeCode)Find allCMSItemModelhaving the same name as the provided value.protected java.util.function.Predicate<java.lang.Object>getCloneContextSameAsActiveCatalogVersionPredicate()protected CMSAdminItemServicegetCmsAdminItemService()protected CMSAdminSiteServicegetCmsAdminSiteService()protected java.util.List<java.util.function.Predicate<CMSItemModel>>getFilters()protected TypeServicegetTypeService()voidsetCloneContextSameAsActiveCatalogVersionPredicate(java.util.function.Predicate<java.lang.Object> cloneContextSameAsActiveCatalogVersionPredicate)voidsetCmsAdminItemService(CMSAdminItemService cmsAdminItemService)voidsetCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)voidsetFilters(java.util.List<java.util.function.Predicate<CMSItemModel>> filters)voidsetTypeService(TypeService typeService)booleantest(CMSItemModel cmsItemModel)Suppress sonar warning (squid:S1166 | Exception handlers should preserve the original exception) : The exception is correctly handled in the catch clause.
-
-
-
Method Detail
-
test
public boolean test(CMSItemModel cmsItemModel)
Suppress sonar warning (squid:S1166 | Exception handlers should preserve the original exception) : The exception is correctly handled in the catch clause.- Specified by:
testin interfacejava.util.function.Predicate<CMSItemModel>
-
findCMSItemByTypeCodeAndName
protected java.util.List<CMSItemModel> findCMSItemByTypeCodeAndName(java.lang.String name, java.lang.String typeCode)
Find allCMSItemModelhaving the same name as the provided value. The result list is filter by applying all the predicates specified by#getFilters().- Parameters:
name- - the name of the itemtypeCode- - the typecode of the item where the lookup takes place- Returns:
- a list of items containing the same name
-
findAbstractParentTypeCode
protected java.lang.String findAbstractParentTypeCode(CMSItemModel cmsItemModel)
Find the abstract parent typecode for a given item model- Parameters:
cmsItemModel- - the item model for which to find the abstract parent typecode- Returns:
- the abstract parent typecode
-
getCmsAdminItemService
protected CMSAdminItemService getCmsAdminItemService()
-
setCmsAdminItemService
public void setCmsAdminItemService(CMSAdminItemService cmsAdminItemService)
-
getCmsAdminSiteService
protected CMSAdminSiteService getCmsAdminSiteService()
-
setCmsAdminSiteService
public void setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)
-
getCloneContextSameAsActiveCatalogVersionPredicate
protected java.util.function.Predicate<java.lang.Object> getCloneContextSameAsActiveCatalogVersionPredicate()
-
setCloneContextSameAsActiveCatalogVersionPredicate
public void setCloneContextSameAsActiveCatalogVersionPredicate(java.util.function.Predicate<java.lang.Object> cloneContextSameAsActiveCatalogVersionPredicate)
-
getTypeService
protected TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getFilters
protected java.util.List<java.util.function.Predicate<CMSItemModel>> getFilters()
-
setFilters
public void setFilters(java.util.List<java.util.function.Predicate<CMSItemModel>> filters)
-
-