Class DefaultEnumerationService

    • Constructor Detail

      • DefaultEnumerationService

        public DefaultEnumerationService()
    • Method Detail

      • getEnumerationValues

        public <T extends HybrisEnumValue> java.util.List<T> getEnumerationValues​(java.lang.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> java.util.List<T> getEnumerationValues​(java.lang.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​(java.lang.String enumerationCode,
                                                                 java.lang.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​(java.lang.Class<T> enumClass,
                                                                 java.lang.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 java.lang.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,
                                       java.lang.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 java.lang.String getEnumerationName​(HybrisEnumValue enumValue,
                                                   java.util.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,
                                       java.lang.String name,
                                       java.util.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