tmf: Add utility method to retrieve field values
It's very common when handling trace events to expect fields
of a certain type. The common pattern to handle an event field
would be:
- field = content.getField()
- make sure field is not null
- value = field.getValue()
- make sure value is not null and of the expected type
Doing this every time we want to read a field is very
cumbersome, we can add a getFieldValue() utility method to
directly get the value into the expected type. So then we
just need to:
- content.getFieldValue(expectedType, fieldName);
- null-check the result
Change-Id: Icff8de7772d8ba8ed66880668cf14c26a07b2573
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/76646
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
This page took 0.024981 seconds and 5 git commands to generate.