Class DefaultComponentTypeMatchingService
java.lang.Object
de.hybris.platform.cmsfacades.types.service.impl.DefaultComponentTypeMatchingService
- All Implemented Interfaces:
ComponentTypeMatchingService
public class DefaultComponentTypeMatchingService
extends Object
implements ComponentTypeMatchingService
Default implementation of
ComponentTypeMatchingService. This is a simple POJO implementation.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultComponentTypeMatchingService(CommonI18NService commonI18NService) Constructor of default implementation ofComponentTypeMatchingService. -
Method Summary
Modifier and TypeMethodDescriptiongetValueOrDefault(String value) Utility function.booleanisTypeMatchingCriteria(ComponentTypeData componentTypeData, Set<String> typeRestrictionsForPage, String mask) This method is used to determine if a given ComponentTypeData is valid based on the given criteria.mapNameForComponentType(ComponentTypeData componentTypeData, String langIsoCode) This method is used to map ComponentType name to name with current langIsoCode.
-
Constructor Details
-
DefaultComponentTypeMatchingService
Constructor of default implementation ofComponentTypeMatchingService.- Parameters:
commonI18NService- The Service for commonI18N to handle I18N.
-
-
Method Details
-
mapNameForComponentType
public ComponentTypeData mapNameForComponentType(ComponentTypeData componentTypeData, String langIsoCode) Description copied from interface:ComponentTypeMatchingServiceThis method is used to map ComponentType name to name with current langIsoCode. Note: If the langIsoCode is empty, the default langIsoCode is en.- Specified by:
mapNameForComponentTypein interfaceComponentTypeMatchingService- Parameters:
componentTypeData- The object that contains the information about the type to check.langIsoCode- The langIsoCode applied when searching. Is applied to name.- Returns:
- ComponentTypeData with langIsoCode name, otherwise ComponentTypeData with empty name.
-
isTypeMatchingCriteria
public boolean isTypeMatchingCriteria(ComponentTypeData componentTypeData, Set<String> typeRestrictionsForPage, String mask) Description copied from interface:ComponentTypeMatchingServiceThis method is used to determine if a given ComponentTypeData is valid based on the given criteria. It checks that the code of the type is included in the given typeRestrictions and that the mask matches either the name or the code. Note: If the mask is empty, this method will skip the name and code check.- Specified by:
isTypeMatchingCriteriain interfaceComponentTypeMatchingService- Parameters:
componentTypeData- The object that contains the information about the type to check.typeRestrictionsForPage- The set of type restrictions that are valid for the page.mask- The mask applied when searching. Is applied to name and code- Returns:
- TRUE if the type is valid for the page, FALSE otherwise.
-
getValueOrDefault
Description copied from interface:ComponentTypeMatchingServiceUtility function. Checks if the given value is null. If it is, the function returns an empty string. Otherwise, it returns the given value.- Specified by:
getValueOrDefaultin interfaceComponentTypeMatchingService- Parameters:
value- the value to check- Returns:
- An empty string if the provided value is null, otherwise the original string.
-