use of io.github.vocabhunter.gui.model.FilterFileMode in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorImpl method fromModel.
@Override
public BaseListedFile fromModel(final FilterFileModel model) {
FilterFileMode mode = model.getMode();
Path file = model.getFile();
switch(mode) {
case SESSION_KNOWN:
return new SessionListedFile(file, false);
case SESSION_SEEN:
return new SessionListedFile(file, true);
case EXCEL:
return new ExcelListedFile(file, model.getColumns());
case DOCUMENT:
return new DocumentListedFile(file);
default:
throw new VocabHunterException("Unsupported mode " + mode);
}
}
Aggregations