question

Upvotes
Accepted
3 4 5 10

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?

ema-apijavaenum
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
17.7k 82 39 63

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());
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 4 5 10

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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.