in src/main/java/deltix/ember/sample/PositionLoadFromCSV.java [112:136]
private static List<ProjectionKey> parseHeader(String [] header) {
List<ProjectionKey> result = new ArrayList<>();
for (int i=0; i < header.length - 1; i++) {
String column = header[i].trim();
try {
result.add(ProjectionKey.valueOf(column));
} catch (IllegalArgumentException e) {
e.printStackTrace();
break;
}
}
if (result.isEmpty())
throw new IllegalArgumentException("CSV Header is empty");
String lastColumn = header[header.length - 1].trim();
if ( ! lastColumn.equals("Size"))
throw new IllegalArgumentException("The last column in the header must be \"Size\", instead got: " + lastColumn);
return result;
}