We are using decode function as is mentioned in the website in REPL mode
import com.thomsonreuters.ema.access.Data
import com.thomsonreuters.ema.access.DataType;
import com.thomsonreuters.ema.access.DataType.DataTypes
import com.thomsonreuters.ema.access.EmaFactory
import com.thomsonreuters.ema.access.FieldEntry
import com.thomsonreuters.ema.access.FieldList
def decode(fieldList: FieldList){
fieldList.forEach( fieldEntry => { print("\tFid: " + fieldEntry.fieldId() + " Name: " + fieldEntry.name() + " DataType: " + DataType.asString(fieldEntry.load().dataType()) + " Value: ")
})
}
but it throws error as below for highlighted part.
<console>:85: error: missing parameter type.
We tried multiple approaches but no luck.
def decode(fieldList: FieldList){
fieldList.forEach( (fieldEntry:FieldEntry) => { print("\tFid: " + fieldEntry.fieldId() + " Name: " + fieldEntry.name() + " DataType: " + DataType.asString(fieldEntry.load().dataType()) + " Value: ")
})
}
<console>:86: error: type mismatch;
found : com.thomsonreuters.ema.access.FieldEntry => Unit
required: java.util.function.Consumer[_ >: com.thomsonreuters.ema.access.FieldEntry]
{ fieldList.forEach( (fieldEntry:FieldEntry) => { print("\tFid: " + fieldEntry.fieldId() + " Name: " + fieldEntry.name() + " DataType: " + DataType.asString(fieldEntry.load().dataType()) + " Value: ")