use of org.fagu.fmv.media.FileType in project fmv by f-agu.
the class List method getFilter.
// *************************************************
/**
* @param args
* @return
*/
private Predicate<FileSource> getFilter(String[] args) {
CommandLine cmdLine = parse(args);
Predicate<FileSource> predicate = null;
for (final FileType fileType : FileType.values()) {
String name = fileType.name().toLowerCase();
if (cmdLine.hasOption(name)) {
Predicate<FileSource> tmp = fs -> fileType == fs.getFileType();
predicate = predicate == null ? tmp : predicate.or(tmp);
}
}
if (predicate == null) {
return s -> true;
}
return predicate;
}
use of org.fagu.fmv.media.FileType in project fmv by f-agu.
the class List method getOptions.
/**
* @see org.fagu.fmv.cli.command.AbstractCommand#getOptions()
*/
@Override
public Options getOptions() {
Options options = super.getOptions();
for (FileType fileType : FileType.values()) {
String name = fileType.name().toLowerCase();
options.addOption(Character.toString(name.charAt(0)), name, false, "");
}
return options;
}
Aggregations