Interface EnumerationService

All Known Implementing Classes:
DefaultEnumerationService

public interface EnumerationService
Provides helpful methods to work with the Enumeration Types.
Spring Bean ID:
enumerationService
  • Method Details

    • getEnumerationValues

      <T extends HybrisEnumValue> List<T> getEnumerationValues(String enumerationCode)
      Returns all Enumerations with matching given enumeration code.
      Parameters:
      enumerationCode - the code of the Enumeration type, e.g. ArticleApprovalStatus.
      Returns:
      List of HybrisEnumValue
      Throws:
      IllegalArgumentException - if given parameter is null.
      UnknownIdentifierException - if given parameter could not be found.
    • getEnumerationValues

      <T extends HybrisEnumValue> List<T> getEnumerationValues(Class<T> enumClass)
      Returns all Enumerations for given enumeration class.
      Parameters:
      enumClass - the enumeration class, e.g. ArticleApprovalStatus. This can either be fixed or dynamic enumeration class.
      Returns:
      List of HybrisEnumValue
      Throws:
      IllegalArgumentException - if given parameter is null.
      UnknownIdentifierException - if given parameter could not be found.
    • getEnumerationValue

      <T extends HybrisEnumValue> T getEnumerationValue(String enumerationCode, String valueCode)
      Returns the Enumeration with matching given enumeration code and value.
      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
      Throws:
      IllegalArgumentException - if given parameters are null.
      UnknownIdentifierException - if given parameters could not be found.
    • getEnumerationValue

      <T extends HybrisEnumValue> T getEnumerationValue(Class<T> enumClass, String valueCode)
      Returns the Enumeration with matching given enumeration class and value.
      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
      Throws:
      IllegalArgumentException - if given parameters are null.
      UnknownIdentifierException - if given parameters could not be found.
    • getEnumerationName

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

      void setEnumerationName(HybrisEnumValue enumValue, String name)
      Changes name for enumeration value (in the current language).
      Parameters:
      enumValue - the value
      name - the new name
    • getEnumerationName

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

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