Convert enum in to its value in EMA Java?

How can we convert an enum (like currency) to a string (like "USD")?

OmmEnum.enumValue() gives the int value, and

OmmEnumImpl.toString() just gives the integer as a string.

How can we obtain the enum text representation?

Tagged:

Best Answer

  • nick.zincone
    nick.zincone admin
    Answer ✓

    Hi @daniel.lipofsky

    Try something like this (taken from the series 300 example: ex332_Dictionary_Streaming).

    System.out.println(fieldEntry.hasEnumDisplay() ? fieldEntry.enumDisplay() : fieldEntry.enumValue());

Answers

  • Thank you, that is exactly what I want. I wonder why they don't mention it in the Developer's Guide?

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.