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 Details

    • DefaultComponentTypeMatchingService

      public DefaultComponentTypeMatchingService(CommonI18NService commonI18NService)
      Constructor of default implementation of ComponentTypeMatchingService.
      Parameters:
      commonI18NService - The Service for commonI18N to handle I18N.
  • Method Details

    • mapNameForComponentType

      public ComponentTypeData mapNameForComponentType(ComponentTypeData componentTypeData, String langIsoCode)
      Description copied from interface: ComponentTypeMatchingService
      This 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:
      mapNameForComponentType in interface ComponentTypeMatchingService
      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: ComponentTypeMatchingService
      This 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:
      isTypeMatchingCriteria in interface ComponentTypeMatchingService
      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

      public String getValueOrDefault(String value)
      Description copied from interface: ComponentTypeMatchingService
      Utility 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:
      getValueOrDefault in interface ComponentTypeMatchingService
      Parameters:
      value - the value to check
      Returns:
      An empty string if the provided value is null, otherwise the original string.