question

Upvotes
Accepted
3 0 0 1

Encoding String into OMM Type in RTSDK-Java (EMA)

I'm encoding my payload into a OMM Message. The old RFA had a utility function in the `OMMEncoder` class, where one could pass a value as `String` and an `OMMType`:

String fvalue = field.getValue();
FidDef fidDef = fieldDict.getFidDef(fname);
encoder.encodeString(fvalue, fidDef.getOMMType());

The encoder encoded the string respectively. Now, I'm wondering is there a similar utility function in the EMA API? Currently I'm handling each case in a separate statement

switch (fieldDictDto.rwfType()) {
    case DataTypes.ENUM -> {
        // Handle enum
    }
    case DataTypes.DATE -> {
        var date = Utils.localDateFromString(fieldValue);
        fieldEntry.date(fid, date.getYear(), date.getMonthValue(), date.getDayOfMonth());
    }
    case ... -> { /*handle more cases*/ }


#technologyema-api#productrfa-apijavaOMM
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.

1 Answer

· Write an Answer
Upvotes
Accepted
79.8k 257 52 74

@len.cewa.williamson

Thanks for reaching out to us.

I checked the EMA reference guide and was unable to find a similar utility function in EMA Java API. I assumed that this feature is not available in EMA Java.

You can raise this as an enhancement request in the API via GitHub.

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.