use of io.github.vocabhunter.analysis.settings.SessionListedFile in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorImpl method translateSession.
private static FilterFileModel translateSession(final BaseListedFile baseListedFile) {
SessionListedFile file = (SessionListedFile) baseListedFile;
FilterFileMode mode;
if (file.isIncludeUnknown()) {
mode = FilterFileMode.SESSION_SEEN;
} else {
mode = FilterFileMode.SESSION_KNOWN;
}
return new FilterFileModel(file.getFile(), mode, Collections.emptySet());
}
use of io.github.vocabhunter.analysis.settings.SessionListedFile in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method testFromSessionKnown.
@Test
public void testFromSessionKnown() {
FilterFileModel model = new FilterFileModel(FILE, FilterFileMode.SESSION_KNOWN, COLUMNS_EMPTY);
validateFromModel(model, new SessionListedFile(FILE, false));
}
use of io.github.vocabhunter.analysis.settings.SessionListedFile in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method testToSessionKnown.
@Test
public void testToSessionKnown() {
SessionListedFile file = new SessionListedFile(FILE, false);
validateToModel(file, FilterFileMode.SESSION_KNOWN, COLUMNS_EMPTY);
}
use of io.github.vocabhunter.analysis.settings.SessionListedFile 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);
}
}
use of io.github.vocabhunter.analysis.settings.SessionListedFile in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method testToSessionSeen.
@Test
public void testToSessionSeen() {
SessionListedFile file = new SessionListedFile(FILE, true);
validateToModel(file, FilterFileMode.SESSION_SEEN, COLUMNS_EMPTY);
}
Aggregations