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*/ }


Best Answer

  • Jirapongse
    Answer ✓

    @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.