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.

hi @daniel.lipofsky

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

Hi @daniel.lipofsky,

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.


Thanks,

AHS

Upvote
Accepted
17.3k 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.