Understanding Issues and the "Result" Wrapper

Sometime a datasource may fail to read a part of the data. For example, a line in an Excel spreadsheet may be badly formatted or maybe a whole spreadsheet could have a wrong format (the columns may not match the data model for instance).

In this case it may still be desirable to read the correct part of the source and skip the corrupted ones, while still reporting the issues that occurred. For this reason, every emitted instance of EntitySource or EntityRecord is wrapped in a Result object when it is emitted. The Result class serves a similar purpose than the java.util.Optional class as it may contain something or be empty, but it also carries a list of issues as instances of the Issue class. This class defines a textual message associated to a criticality level (INFO, WARNING or ERROR) and an abstract Location instance that can be converted to a textual representation of where the issue occurred (for example, as "spreadsheet Activity, line 4").