Interface ComponentTypeMatchingService

All Known Implementing Classes:
DefaultComponentTypeMatchingService

public interface ComponentTypeMatchingService
Service that matches the ComponentTypeData from a given componentTypeData for different criteria.
  • Method Details

    • mapNameForComponentType

      ComponentTypeData mapNameForComponentType(ComponentTypeData componentTypeData, String langIsoCode)
      This method is used to map ComponentType name to name with current langIsoCode. Note: If the langIsoCode is empty, the default langIsoCode is en.
      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

      boolean isTypeMatchingCriteria(ComponentTypeData componentTypeData, Set<String> typeRestrictionsForPage, String mask)
      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.
      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

      String getValueOrDefault(String value)
      Utility function. Checks if the given value is null. If it is, the function returns an empty string. Otherwise, it returns the given value.
      Parameters:
      value - the value to check
      Returns:
      An empty string if the provided value is null, otherwise the original string.