cancel
Showing results for 
Search instead for 
Did you mean: 

Enum: Get code and localized name

Former Member
0 Kudos

Hi,

I'm using the flexible search to get all enum values of one type, we have also the localized name filled for this enum. But how can I get the name from the enum object?

Because it has only get methodes for the following properties:

  • getClass()

  • getCode()

  • getType()

Thanks for you help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

I normally use the enumerationService. There's a method on there called getEnumerationName(..).

Former Member
0 Kudos

Thanks! I just found it some minutes ago!

         List<ReasonCodeEnum> reasonCodes = enumerationService.getEnumerationValues(ReasonCodeEnum.class);
                 
         for (ReasonCodeEnum reasonCode : reasonCodes) {
             String name = enumerationService.getEnumerationName(reasonCode, new Locale("en", "US"));
         }

Answers (0)