Class DefaultEnumerationService

java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.enumeration.impl.DefaultEnumerationService
All Implemented Interfaces:
EnumerationService, Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean

public class DefaultEnumerationService extends AbstractService implements EnumerationService
Default implementation of EnumerationService
See Also:
  • Constructor Details

    • DefaultEnumerationService

      public DefaultEnumerationService()
  • Method Details

    • getEnumerationValues

      public <T extends HybrisEnumValue> List<T> getEnumerationValues(String enumerationCode)
      Returns all Enumerations with matching given enumeration code.
      Specified by:
      getEnumerationValues in interface EnumerationService
      Parameters:
      enumerationCode - the code of the Enumeration type, e.g. ArticleApprovalStatus.
      Returns:
      List of HybrisEnumValue
    • getEnumerationValues

      public <T extends HybrisEnumValue> List<T> getEnumerationValues(Class<T> enumClass)
      Description copied from interface: EnumerationService
      Returns all Enumerations for given enumeration class.
      Specified by:
      getEnumerationValues in interface EnumerationService
      Parameters:
      enumClass - the enumeration class, e.g. ArticleApprovalStatus. This can either be fixed or dynamic enumeration class.
      Returns:
      List of HybrisEnumValue
    • getEnumerationValue

      public <T extends HybrisEnumValue> T getEnumerationValue(String enumerationCode, String valueCode)
      Returns the Enumeration with matching given enumeration code and value.
      Specified by:
      getEnumerationValue in interface EnumerationService
      Parameters:
      enumerationCode - the code of the Enumeration type, e.g. ArticleApprovalStatus.
      valueCode - the value code of the Enumeration item, e.g. check, approval, etc...
      Returns:
      Enumeration value as HybrisEnumValue implementation
    • getEnumerationValue

      public <T extends HybrisEnumValue> T getEnumerationValue(Class<T> enumClass, String valueCode)
      Description copied from interface: EnumerationService
      Returns the Enumeration with matching given enumeration class and value.
      Specified by:
      getEnumerationValue in interface EnumerationService
      Parameters:
      enumClass - the enumeration class, e.g. ArticleApprovalStatus. This can either be fixed or dynamic enumeration class.
      valueCode - the value code of the Enumeration item, e.g. check, approval, etc...
      Returns:
      Enumeration value as HybrisEnumValue implementation
    • getEnumerationName

      public String getEnumerationName(HybrisEnumValue enumValue)
      Provides name for enumeration value (in the current language).
      Specified by:
      getEnumerationName in interface EnumerationService
      Parameters:
      enumValue - the value
      Returns:
      the enum localized name
    • setEnumerationName

      public void setEnumerationName(HybrisEnumValue enumValue, String name)
      Changes name for enumeration value (in the current language).
      Specified by:
      setEnumerationName in interface EnumerationService
      Parameters:
      enumValue - the value
      name - the new name
    • setTypeService

      public void setTypeService(TypeService typeService)
    • setModelService

      public void setModelService(ModelService modelService)
    • getEnumerationName

      public String getEnumerationName(HybrisEnumValue enumValue, Locale locale)
      Provides name for enumeration value using the given locale.
      Specified by:
      getEnumerationName in interface EnumerationService
      Parameters:
      enumValue - the value
      locale - the locale to match
      Returns:
      the enum localized name
    • setEnumerationName

      public void setEnumerationName(HybrisEnumValue enumValue, String name, Locale locale)
      Changes name for enumeration value using the given locale.
      Specified by:
      setEnumerationName in interface EnumerationService
      Parameters:
      enumValue - the value
      name - the new name
      locale - the locale to match